Can module tell if running from interpreter vs Windows command line ?
pdlemper at earthlink.net
pdlemper at earthlink.net
Wed Jul 15 21:36:57 EDT 2009
On Wed, 15 Jul 2009 19:07:18 -0500, pdlemper at earthlink.net wrote:
>The WConio console module produces different colors, sometimes quite
>different, when run from Windows command line vs from Python
>interpreter >>> . A good foregnd/backgnd combination under one
>may be unreadable under the other : (
>I'm using Python 3.0 with the corresponding WConio on XP.
>Is there any way for the module to detect under which it has been
>started ? Thanks
Thanks Alex It worked :
import sys
hasattr(sys, 'ps1') yields True when started from interpreter >>>
and False run from Windows command line
Dave WB3DWE
More information about the Python-list
mailing list