how do I know if I'm using a debug build of python

Discussion in 'Python' started by Tim Mitchell, Apr 17, 2008.

  1. Tim Mitchell

    Tim Mitchell Guest

    Hi,

    A quick question:
    Is there any way for a python script to know if it's being executed by a
    debug build of python (python_d.exe) instead of python?

    Thanks
    Tim
     
    Tim Mitchell, Apr 17, 2008
    #1
    1. Advertising

  2. Tim Mitchell

    bgeddy Guest

    Tim Mitchell wrote:
    > Hi,
    >
    > A quick question:
    > Is there any way for a python script to know if it's being executed by a
    > debug build of python (python_d.exe) instead of python?
    >
    > Thanks
    > Tim
    >

    Not sure what this returns in Windows as I run Linux but this returns to
    namer of the python executable for my setup - maybe its what you want.

    import sys
    print sys.executable

    - will print out the name of the python executable.
     
    bgeddy, Apr 18, 2008
    #2
    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. Mike C. Fletcher
    Replies:
    3
    Views:
    988
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Oct 12, 2003
  2. Shankar KN

    Python Installation (Debug Build)

    Shankar KN, Aug 12, 2004, in forum: Python
    Replies:
    0
    Views:
    280
    Shankar KN
    Aug 12, 2004
  3. Replies:
    0
    Views:
    541
  4. Andries

    I know, I know, I don't know

    Andries, Apr 23, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    240
    Gregory Toomey
    Apr 23, 2004
  5. Aseem Bansal
    Replies:
    22
    Views:
    241
    Schneider
    Sep 26, 2013
Loading...

Share This Page