standard i/o with os.execl()

Brian Lee senux at
Wed Aug 28 07:35:15 CEST 2002


I linked standard input/output to a socket by these lines.

sys.stdin  = conn.makefile('rb', -1)
sys.stdout = conn.makefile('wb',  0)
sys.stderr = sys.stdout
print 'hello world'

And it works: When I connect to my test server, I got 'hello
world' string immediately. 

But when I use follow line, 'hello world (') string does
not printed through socket, but it printed on terminal which I
start my test server.

os.execv('', ('', ''))

#!/usr/bin/env python
print 'hello world ('

How can I fully link standard input/output to socket even in
os.exec*() functions? Any advice?

 |o | i   / Brian Lee    <senux at>
 #######|<  Web -
(x-x-x-x) \ GnuPG public key - 0x46C763A3

More information about the Python-list mailing list