Test for Pythonwin?

S

steve

Is there a good way to check if a script is running inside Pythonwin?
Perhaps a property or method that is exposed by that environment?

or, alternatively, is there a better place to ask :)

Steven
 
R

Roger Miller

Is there a good way to check if a script is running inside Pythonwin?
Perhaps a property or method that is exposed by that environment?

I've used
if sys.stdin.fileno() < 0:
This is not precisely a test for pythonwin, but indicates whether
standard streams are available, which is usually what I really
want to know.
 
S

steve

steve said:
Is there a good way to check if a script is running inside Pythonwin?
Perhaps a property or method that is exposed by that environment?

or, alternatively, is there a better place to ask :)

Steven


'pywin' in sys.modules

Didn't want to check for redirection because my redirection code is in
a different thread, and I'd have to think about thread synchronization as
well.

Thanks guys,
Steven
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top