[EMAIL PROTECTED] wrote:

>         I have python script in which i have some print statements.
>         I dont want the outputs of print to be displayed on the console
>         since it is used my fellow-workers
>         But i need those prints for debugging purpose
>         So some how i want to capture those prints
>         can u please suggest

you can print directly to a log file:

    mylogfile = open("logfile.txt", "a")

    print >>mylogfile, "my log message"

or you can replace sys.stdout (and/or sys.stderr) with the log file object:

    import sys
    sys.stdout = sys.stderr = open("logfile.txt", "a")

or you can use the "logging" module:

    http://docs.python.org/lib/module-logging.html

etc.

hope this helps!

</F>



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to