How do I detect if a script is run from a Windows console or from Komodo debugger without passing different arguments to the script?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With