Run the python script from within python and also catch the exception.
File: test1.py
try:
a = 1/0
except:
raise
File: test2.py
import subprocess
subprocess.call('python test.py', shell=True)
How do I run test1.py and also catch the ZeroDivisionError in test2.py?
source
to share