[Tutor] Subprocess communications query

Steve Willoughby steve at alchemy.com
Tue Dec 10 20:49:36 CET 2013


Reuben <reuben.dlink at gmail.com> wrote:
>I want to implement a python script on machine A to do telnet/ssh into
>machine B (this might be easy)and then run the Test.py (this is
>challenging)
>On 11-Dec-2013 1:05 AM, "Danny Yoo" <dyoo at hashcollision.org> wrote:
>
>> On Tue, Dec 10, 2013 at 11:28 AM, Reuben <reuben.dlink at gmail.com>
>wrote:
>> > Hi,
>> >
>> > There exists two Linux machines A and B. Machine B contains python
>script
>> > which needs to be run e.g. Test.py
>> >
>> > In order to run that script, machine A needs to telnet into machine
>B and
>> > then execute "python Test.py"
>>
>> Nothing about this sounds like Python.  Is there anything
>specifically
>> Python-related to this question, besides the detail that machine B is
>> running a Python program?
>>
>> This really sounds like more like a Linux system administration
>> question.  If that's the case, you probably want to ask on a forum
>for
>> system administrators, like:
>>
>>     http://unix.stackexchange.com/
>>
>> where they'll be able to point you in a better direction than us.
>>
>> (By the way, when you say "telnet", I do hope you do not literally
>> mean telnet, which is not known to be secure.  You need to talk with
>> other system administrators and learn about tools like ssh.)
>>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Tutor maillist  -  Tutor at python.org
>To unsubscribe or change subscription options:
>https://mail.python.org/mailman/listinfo/tutor

You could do many different things depending on your needs. You could write a daemon in python on one machine which waits for a python program on the other to command it to run a process. 

You could find out how to accomplish this using ssh and then just write a python script to execute that ssh command for you. 

Without more details it's hard too say what is more appropriate but I would suggest reading up on python subprocess module, ssh, and internet protocol and server modules in the standard library.
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131210/2e2798d7/attachment.html>


More information about the Tutor mailing list