Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #97279

Re: reg multiple login python

From Laura Creighton <lac@openend.se>
Subject Re: reg multiple login python
References <2fe53246-4212-4cfd-896b-acf8e8e88b09@googlegroups.com> <a1b0c609-e1ae-4c6c-9ab6-2826fd7b5e8b@googlegroups.com>
Date 2015-10-01 14:26 +0200
Newsgroups comp.lang.python
Message-ID <mailman.290.1443702414.28679.python-list@python.org> (permalink)

Show all headers | View raw


In a message of Thu, 01 Oct 2015 03:07:14 -0700, harirammanohar159@gmail.com wr
ites:
>On Thursday, 1 October 2015 12:35:01 UTC+5:30, hariramm...@gmail.com  wrote:
>> Hi All,
>> 
>> Is there anyway i can login to remote servers at once and do the activity, i can do one by one using for loop..
>> 
>> Thanks in advance.
>
>Hi Laura,
>
>at the same time means...
>i have an activity say on two servers serverA and serverB, my aim is to do the activity using script by logging in to both servers serverA and serverB at the same time and not one by one. hope this time i am able to convey :)
>
>in earlier post the way you suggested will work only as one by one..
>
>Thanks.

I am still not understanding.

Is your problem that you don't want to wait for the script to be done
on machine A before you go to machine B?

fork a separate process for each machine.

You could even do this in, for instance, a bash shell.
Given a script called myscript.py that takes a machine name as an argument.

for machine in `cat list_of_machines`
        do
	python --machine $machine myscript.py &
	done
	
if you need to do this inside python see
os.fork https://docs.python.org/3.4/library/os.html
and make sure you read about the problems with ssl if
you care.  https://docs.python.org/3.4/library/ssl.html#module-ssl

Most people don't need any more 'at the same time' than this.
Do you?

Laura

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

reg multiple login python harirammanohar159@gmail.com - 2015-10-01 00:04 -0700
  Re: reg multiple login python Laura Creighton <lac@openend.se> - 2015-10-01 09:17 +0200
  Re: reg multiple login python harirammanohar159@gmail.com - 2015-10-01 01:25 -0700
    Re: reg multiple login python Laura Creighton <lac@openend.se> - 2015-10-01 11:10 +0200
    Re: reg multiple login python Michael Ströder <michael@stroeder.com> - 2015-10-01 11:17 +0200
  Re: reg multiple login python harirammanohar159@gmail.com - 2015-10-01 03:07 -0700
    Re: reg multiple login python Laura Creighton <lac@openend.se> - 2015-10-01 14:26 +0200
  Re: reg multiple login python harirammanohar159@gmail.com - 2015-10-01 03:09 -0700
  Re: reg multiple login python harirammanohar159@gmail.com - 2015-10-04 21:01 -0700
  Re: reg multiple login python harirammanohar159@gmail.com - 2015-10-04 21:06 -0700
  Re: reg multiple login python harirammanohar159@gmail.com - 2015-10-05 03:13 -0700
  Re: reg multiple login python harirammanohar159@gmail.com - 2015-10-05 20:22 -0700
  Re: reg multiple login python harirammanohar159@gmail.com - 2015-10-06 02:09 -0700
  Re: reg multiple login python harirammanohar159@gmail.com - 2015-10-06 20:47 -0700
  Re: reg multiple login python harirammanohar159@gmail.com - 2015-10-07 02:24 -0700
    Re: reg multiple login python Emile van Sebille <emile@fenx.com> - 2015-10-07 09:58 -0700
  Re: reg multiple login python harirammanohar159@gmail.com - 2015-10-08 03:03 -0700
    Re: reg multiple login python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-10-08 08:42 -0400
  Re: reg multiple login python harirammanohar159@gmail.com - 2015-10-09 02:07 -0700

csiph-web