If I run a python script via python foo.py then I can get the contents of the script by reading the file sys.argv[0]. Is it possible to get the contents of the script (e.g., as a string) if the script is passed to the python interpreter via python -c "$(cat foo.py)"?
If I run a python script via python foo.py then I can get the
Share
As far as I know, it’s not possible.