can we save print msg into a file when script running ?
__peter__ at web.de
Wed Oct 12 16:37:59 CEST 2005
> in my .py file there are a few print to trace out some message and i
> wonder if we can save it into a specified file when that script get
> running. if so, i may just check that file to c how the script is
> running. can anyone show me a right direction ?
If you don't feel comfortable with the command line you can stick
sys.stdout = open("mylogfile.txt", "w")
at the beginning of your file.
More information about the Python-list