[Python-Dev] a quit that actually quits

"Martin v. Löwis" martin at v.loewis.de
Tue Dec 27 22:41:31 CET 2005


Fredrik Lundh wrote:
> (it would be nice if it was possible to detect "interactive mode" when the site
> code runs, though.  does anyone know if that's possible ?)

I believe checking sys.argv==[''] is a nearly reliable test (the only
other case where I could make it happen is when the script is read from
stdin). Introducing a flag into InteractiveLoop would be an option, too.

Regards,
Martin


More information about the Python-Dev mailing list