0

My script can run under OS shell, or be embedded in another software, which still uses the same interpreter, but not under OS shell.

Is there a way to tell where my script is running in this case? Will I know with the sys module?

Russ Schultz
  • 2,210
  • 18
  • 19
kakyo
  • 8,886
  • 12
  • 62
  • 119
  • 1
    See if this answers your question https://stackoverflow.com/questions/6108330/checking-for-interactive-shell-in-a-python-script?noredirect=1&lq=1 – Russ Schultz May 29 '18 at 19:37
  • Depends what you mean by 'embedded' and how the software invokes the script. There may be a few ways to differentiate these two cases. – sytech May 29 '18 at 20:15

0 Answers0