trouble with sys.exec and sockets/ssh

Richard Cook rcook at llnl.gov
Fri Feb 21 21:51:44 EST 2003


At 4:12 PM -0800 2/21/03, Geoff Gerrietts wrote:
>Quoting Richard Cook (rcook at llnl.gov):
>>  At 7:52 PM +0000 2/21/03, Donn Cave wrote:
>>
>>  I knew this question would cause confusion.  Here is my example program:
>>
>>  import os
>>  os.execv('ensight7.sos', 'ensight7.sos', '-c', 'somehost.somewhere.gov')
>
>
>I believe your problem is a consequence of ssh expecting to read and
>write to a terminal (tty). I believe if you use the pty module,
>pty.spawn() will do what you need. If you need more direct
>programmatic control over the spawned creature, I think the pexpect
>module (http://pexpect.sourceforge.net) might give you some quality
>results.

Well, it sounds good, but the ssh process is actually spawned by 
ensight7.sos, not by my python script.  So what's weird is that it 
works for ensight7.sos from the command line, but not for me. 
Clearly ensight is doing something vis a viz their environment more 
wisely than am I!  Anyhoo, I'll check into pty.spawn and see what 
happens there.  Thanks for the suggestion.  I don't know anything 
about pseudoterminals, but i guess it's time to learn... Damn the 
Fates!
You might have the answer to my other problem, though... (see my other thread)

>
>I could be mistaken, but this is a problem I have had in the past, and
>that's how I resolved it, so if it doesn't work for you, I can only
>apologize for your wasted time.
>
>Thanks,
>--G.
>
>--
>Geoff Gerrietts                                 <geoff at gerrietts net>
>"A man can't be too careful in the choice of his enemies." --Oscar Wilde


-- 
Richard Cook  
Lawrence Livermore National Laboratory
Bldg-451 Rm-2043, Mail Stop L-561       
7000 East Avenue,  Livermore, CA, 94550, USA
phone (925) 423-9605 (work)    fax (925) 423-8704
---
Information Management & Graphics Grp., Services & Development Div., 
Integrated Computing & Communications Dept.
(opinions expressed herein are mine and not those of LLNL)





More information about the Python-list mailing list