If I have a script, lets call it "scr.sh" And I call it from another language e.g Python Is there a way to get the traceback of the functions and files back to the Python language.
How I think it could possibly work: the scr.sh
echo "something"
echo `get_traceback` > "/tmp/traceback"
echo "something else
And a python script "scr2.py"
if __name__ == '__main__'
self.call_func()
def call_func(self):
import subprocess
print "some"
subprocess.call("scr.sh")
print "thing"
Can I get the traceback the from the bash script back to the python script? I'd expect that if it exists it would look like this:
file /tmp/scr2.py , line 2 in function "main",
file /tmp/scr2.py , line 7 in function "call_func",
bash file /tmp/scr.sh, line 2