Answers for "error print python"

9

except as Exception:

>>> def catch():
...     try:
...         asd()
...     except Exception as e:
...         print e.message, e.args
... 
>>> catch()
global name 'asd' is not defined ("global name 'asd' is not defined",)
Posted by: Guest on April-28-2020
0

python print error output

print("spam", file=sys.stderr)
Posted by: Guest on July-20-2021

Python Answers by Framework

Browse Popular Code Answers by Language