473,386 Members | 1,610 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,386 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 1350
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 --...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.