When programming in the two IDEs i used, bad things happen when i use raw_input. However on the command line it works EXACTLY how i expect it to. Typically this app is ran in cmd line but i like to edit and debug it in an IDE. Is there a way to detect if i executed the app in an IDE or not?
+3
A:
if sys.stdin.isatty():
# command line (not a pipe, no stdin redirection)
else:
# something else, could be IDE
J.F. Sebastian
2009-02-16 08:39:45
A:
I would strongly advise (and you have been previously advised on this) to use a good IDE, and a good debugger instead of hacking around your code to fix something that shouldn't be broken in the first place.
I deserve to be down-voted for not answering the question, but please consider this advice for your future sanity.
I would personally recommend Winpdb debugger and PIDA IDE
Ali A
2009-02-16 13:30:24