command line or idle?

Discussion in 'Python' started by sjf, Sep 23, 2003.

  1. sjf

    sjf Guest

    Is it possible to distinguish if script is running on python command line
    (python.exe) or IDLE?


    --
    regards,
    sjf :)
    sjf, Sep 23, 2003
    #1
    1. Advertising

  2. sjf

    Bob Gailer Guest

    At 07:17 AM 9/23/2003, sjf wrote:

    >Is it possible to distinguish if script is running on python command line
    >(python.exe) or IDLE?


    search archive; several threads on this recently.


    Bob Gailer

    303 442 2625


    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.506 / Virus Database: 303 - Release Date: 8/1/2003
    Bob Gailer, Sep 23, 2003
    #2
    1. Advertising

  3. sjf wrote:

    > Is it possible to distinguish if script is running on python command line
    > (python.exe) or IDLE?


    Not in entirely reliable way, but there are many hints you can generally
    rely on. For example, in the IDLE "Python Shell" sys.stdout is an
    instance of idlelib.rpc.RPCProxy (in IDLE 1.0) -- that MIGHT happen
    even "on python command line", of course, but it is not very likely to.


    Alex
    Alex Martelli, Sep 23, 2003
    #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. sjf

    command line or idle?

    sjf, Sep 23, 2003, in forum: Python
    Replies:
    0
    Views:
    265
  2. Mark Hadfield

    IDLE vs Command Line

    Mark Hadfield, Aug 11, 2004, in forum: Python
    Replies:
    4
    Views:
    1,024
    Jesse B.
    Aug 11, 2004
  3. Otto T Hyvarinen

    IDLE vs. the command line?

    Otto T Hyvarinen, Sep 15, 2004, in forum: Python
    Replies:
    2
    Views:
    373
    Istvan Albert
    Sep 15, 2004
  4. Robert D. Young
    Replies:
    2
    Views:
    323
    Robert D. Young
    May 2, 2005
  5. crypto
    Replies:
    4
    Views:
    4,496
Loading...

Share This Page