REPOST: Re: 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/

========= WAS CANCELLED BY =======:
Path: news.sol.net!spool0-milwwi.newsops.execpc.com!newsfeeds.sol.net!news-out.visi.com!hermes.visi.com!news.tele.dk!small.news.tele.dk!134.75.7.11!nntp.kreonet.re.kr!news.kigam.re.kr!feeder.kornet.net!news1.kornet.net!ua4canc3ll3r
From: Carey Evans <careye at spamcop.net>
Newsgroups: comp.lang.python
Subject: cmsg cancel <87g05wgq84.fsf at psyche.dnsalias.org>
Control: cancel <87g05wgq84.fsf at psyche.dnsalias.org>
Date: Mon, 31 Dec 2001 05:00:42 GMT
Organization: A poorly-installed InterNetNews site
Lines: 2
Message-ID: <cancel.87g05wgq84.fsf at psyche.dnsalias.org>
NNTP-Posting-Host: 211.57.49.2
X-Trace: news2.kornet.net 1009775482 27193 211.57.49.2 (31 Dec 2001 05:11:22 GMT)
X-Complaints-To: usenet at news2.kornet.net
NNTP-Posting-Date: Mon, 31 Dec 2001 05:11:22 +0000 (UTC)
X-No-Archive: yes
X-Unac4ncel: yes
X-Commentary: I love NewsAgent 1.10 and the Sandblaster Cancel Engine Build 74 (19 March 1999)

This message was cancelled from within Mozilla.



More information about the Python-list mailing list