0

I have a several diferent shell scripts calling one single python script.

I'm trying to figure out how can I know which shell script is calling my python script within the python script.

I've already tried with "inspect.stack" but it only gives me the python script itself.

Any suggestion how to do this? Something similar to ${BASH_SOURCE} in shell script

Note: I'm using python 2.6

Thanks

FerFig
  • 113
  • 9
  • You could pass an argument to the python script when you calling from a bash script, different argument value for each bash script and you have access to the command line argument inside your python script. – Jeeva Jan 11 '21 at 13:10
  • that's not an option because I don't want to go through all the original bash scripts and change them nor even I know where all the scripts are located.That's why I whant to know withint the python script where is it called from. – FerFig Jan 11 '21 at 14:14

0 Answers0