Checking if program is run in IDLE

TrustyTony

While looking stuff about idlelib, I came to this thread in stackoverflow, so I posted own solution. I post it also here, as maybe somebody needs it (as for example \b looks ugly in IDLE)

200 Views
About the Author

IT Pro doing Eng-Fin-Eng translations

import sys
print('Running IDLE' if 'idlelib.run' in sys.modules else 'Out of IDLE')