sys.stdout .>_<.

Leon square690410 at yahoo.com.tw
Fri Nov 5 05:00:41 EST 2004


import os,sys
a = os.fdopen(sys.stdout.fileno(),"w")
b = os.fdopen(sys.stdout.fileno(),"w")
a.write("test1 ")
b.write("test2 ")

stdout result is

test1 test2

but use general file object such as...

a = open("test.txt","w")
b = open("test.txt","w")
a.write("test1")
b.write("test2")

the "test.txt" file content is

test2

how to do this result to sys.stdout





More information about the Python-list mailing list