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. Advertisements

  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. Advertisements

  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. Advertisements

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. Sting
    Replies:
    5
    Views:
    1,836
    Natty Gur
    Jun 8, 2004
  2. Robert Allan Schwartz
    Replies:
    7
    Views:
    571
    Marco Manfredini
    Aug 13, 2004
  3. Chris
    Replies:
    1
    Views:
    774
    Chris
    May 11, 2006
  4. stephan
    Replies:
    0
    Views:
    610
    stephan
    Jul 30, 2003
  5. Edvard Majakari
    Replies:
    4
    Views:
    889
    Edvard Majakari
    Feb 25, 2005
  6. arotem
    Replies:
    4
    Views:
    9,930
    arotem
    Oct 17, 2005
  7. Noah
    Replies:
    1
    Views:
    543
    Peter Hansen
    Jan 31, 2006
  8. Skybuck Flying

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

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