Finding out that Python is in interactive mode in sitecustomize.py

Carey Evans careye at spamcop.net
Thu Dec 27 19:09:31 EST 2001


Joonas Paalasmaa <joonas at olen.to> writes:

> How can I find out that Python is started in interactive mode in
> sitecustomize.py ?

A search on http://groups.google.com/ for "python test interactive"
comes up with this as the second result:

    import sys
    if hasattr(sys, "ps1"):
        # probably interactive
    else:
        # probably not interactive

-- 
	 Carey Evans  http://home.clear.net.nz/pages/c.evans/



More information about the Python-list mailing list