(no subject)

ed_tsang at yahoo.com ed_tsang at yahoo.com
Mon Apr 30 12:47:23 EDT 2001


 I am trying to print the traceback infor using the floowing code. I 
get the traceback info form call traceback.print_exception. the file 
that I want o print to is trcfile whihc has value of error.txt. 
How can I do that?? thanks


 trcfile = "error.txt"
 try:
     
    execCmd = "guiCb.pixitObj.%s"%eventHandler[0]
    exec(execCmd)
 except:
                         
    printwrite(trcfile, "Ctf Error   : Error executing eventhandler %
s \nTraceback detail follows:\n"%eventHandler[0], "FAIL")
    exc = sys.exc_info()
                        
    try:
        traceback.print_exception(exc[0],exc[1],exc[2],file = trcfile)
    finally:
        pass
    print "Test case fail exception raised\n"
    raise TestCaseFail





More information about the Python-list mailing list