473,240 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,240 software developers and data experts.

How to find out if the interpreter is a debug build?

How can i find out if a selected python interpreter (i only know the
path name under which i should start it) is a debug build? I tried

sys.api_version, sys.platform, sys.version, sys.version_info

and there is no difference between "python.exe" and "python_d.exe".
I'm pretty sure the information is stored somewhere but i can't find
it. Please help.

Sep 1 '07 #1
5 1345
In message <11*********************@i13g2000prf.googlegroups. com>, llothar
wrote:
How can i find out if a selected python interpreter (i only know the
path name under which i should start it) is a debug build?
What's the difference in their behaviour?
Sep 1 '07 #2
llothar schrieb:
How can i find out if a selected python interpreter (i only know the
path name under which i should start it) is a debug build? I tried

sys.api_version, sys.platform, sys.version, sys.version_info

and there is no difference between "python.exe" and "python_d.exe".
Sure there is:

if sys.executable.endswith("_d.exe"):
print "Debug version"

If relying on the executable name is too unsafe, you can also look
at imp.get_suffixes(), which includes "_d.pyd" in a debug build on
Windows.

If you want it cross-platform, you can check whether sys.getobjects
is available. That, of course, is also unsafe because there isn't
a single "debug build" on Unix, but instead, several debugging
features can be enabled and disabled separately, so you would have
to specify first what precisely a debug build is.

Regards,
Martin
Sep 1 '07 #3
On 1 Sep., 10:37, Lawrence D'Oliveiro <l...@geek-
central.gen.new_zealandwrote:
In message <1188609417.273513.74...@i13g2000prf.googlegroups. com>, llothar
wrote:
How can i find out if a selected python interpreter (i only know the
path name under which i should start it) is a debug build?

What's the difference in their behaviour?
Total different and total incompatible behaviour if you write
an IDE (Debugger/Profiler etc.)

And total different for binary extensions.

Sep 1 '07 #4
On 1 Sep., 13:25, "Martin v. Löwis" <mar...@v.loewis.dewrote:
If you want it cross-platform, you can check whether sys.getobjects
is available. That, of course, is also unsafe because there isn't
a single "debug build" on Unix, but instead, several debugging
features can be enabled and disabled separately, so you would have
to specify first what precisely a debug build is.
I thought that the answer is as complicated as this. At the moment it
would be nice and enough if i only can find out if my binary
extension can be loaded into an interpreter or if this requires a
new extension build.

It is a huge problem and weakness of python if this is impossible
with
debug builds. And if you answer that this is up to the user, i have
to
say, no it isn't: At least if you are like me and are working on an
IDE with a debugger component.
Sep 1 '07 #5
It is a huge problem and weakness of python

Would you like to contribute a patch?

Regards,
Martin
Sep 1 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Rafal Kleger-Rudomin | last post by:
Hello, I'm looking for a command to reset interpreter's environment i.e. unload all modules, delete variables etc. Regards, Rafal
1
by: Peter Newman | last post by:
I'm embedding a Python interpreter into a project, and compiling with MSVC. It all runs great in the "Debug" configuration, but everything gets scary when I switch to "Release". I've read about...
21
by: Chris Durkin | last post by:
I've got an ASP.NET website on my local box, set to compile to bin\Debug and bin\Release in debug and release modes. Both directories are populated with dlls, as the solution has been compiled in...
2
by: Jim | last post by:
I am trying to figure out how to embed Python in a little C++ Windows console app. Here's the code: // Py_Initialize(); Py_InitializeEx(0); PyRun_SimpleString("from win32com.client import *");...
0
by: Simon Eves | last post by:
I am trying to write a Python module to embed the functionality of Maya (the 3D modelling and animation application from Autodesk, formerly Alias) for doing scripted scene manipulation and...
6
by: Andrew Rowley | last post by:
I am having trouble getting debug and release builds to work properly with project references using C++ .NET and Visual Studio 2003. I created a test solution, with a basic Windows form C++...
6
by: Benny the Guard | last post by:
Been working on a project that compiles, links, and runs fine on 32-bit windows. Now trying to migrate to 64-bit windows. On debug build it works fine. However, on release build the std::map::find...
3
by: R. Bernstein | last post by:
The next release of pydb will have the ability to go into ipython from inside the debugger. Sort of like how in ruby-debug you can go into irb :-) For ipython, this can be done pretty simply;...
5
by: Erik Hahn | last post by:
I'm looking for a standalone Javascript interpreter like the ones of Perl and Python. Does such a thing exist for Linux? Thanks in advance. -Erik --...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.