3

How do I detect if a script is run from a Windows console or from Komodo debugger without passing different arguments to the script?

2
  • have you inspected sys.argv ? Commented May 20, 2011 at 7:04
  • @Sentinel: I would prefer not to use args to distinguish. Commented May 20, 2011 at 7:10

1 Answer 1

4

Although I don't know Komodo, I don't think its standard input is interactive, so you could try

import sys
in_console = sys.__stdin__.isatty()

in_console will then be true if the invoker provides interactive stdin and you will get what you want, though not in an elegant way.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.