sys.stdout .>_<.
Leon
square690410 at yahoo.com.tw
Fri Nov 5 05:00:41 EST 2004
More information about the Python-list mailing list
Fri Nov 5 05:00:41 EST 2004
- Previous message (by thread): sys.stdout .>_<.
- Next message (by thread): sys.stdout .>_<.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message (by thread): sys.stdout .>_<.
- Next message (by thread): sys.stdout .>_<.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list