Test for Pythonwin?

Discussion in 'Python' started by steve, Jul 31, 2009.

  1. steve

    steve Guest

    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
    steve, Jul 31, 2009
    #1
    1. Advertising

  2. steve

    Roger Miller Guest

    On Jul 31, 2:09 am, "steve" <> wrote:
    > 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.
    Roger Miller, Jul 31, 2009
    #2
    1. Advertising

  3. steve

    steve Guest

    "steve" <> wrote in message
    news:4a728aac$0$9744$...
    > 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
    steve, Aug 3, 2009
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ilariu Raducan

    PythonWin dynamic toolbar

    Ilariu Raducan, Jul 7, 2003, in forum: Python
    Replies:
    0
    Views:
    314
    Ilariu Raducan
    Jul 7, 2003
  2. Richard Lee
    Replies:
    2
    Views:
    423
    Daniel Dittmar
    Jul 22, 2003
  3. Adam
    Replies:
    0
    Views:
    325
  4. stephan
    Replies:
    0
    Views:
    425
    stephan
    Jul 30, 2003
  5. Skybuck Flying

    Call oddities: &Test() vs &Test vs Test

    Skybuck Flying, Oct 4, 2009, in forum: C Programming
    Replies:
    1
    Views:
    680
    Skybuck Flying
    Oct 4, 2009
Loading...

Share This Page