A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/106077.html below:

how to enable error message in exec??

how to enable error message in exec?? how to enable error message in exec??ed_tsang at yahoo.com ed_tsang at yahoo.com
Sun Apr 8 13:00:13 EDT 2001
Hi 

My current script, say script A, need to execute some python code in 
other file, say script B,  by using exec() function. But if there is 
any syntax error in script B, the exec() returns, but I would not 
know what kind of syntax error is that. How can I enable this kind of 
execution gives the same level of error reporting capability as if 
the python code is run thorugh in the same file?


Code fragment:

execCmd = "guiCb.pixitObj." + eventHandler[0]
                         
exec(execCmd)

where execCmd is just a string containing the full execution python 
code. eventHandler[0] is a python code read from script B.

Thanks    



More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4