473,465 Members | 1,934 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Running PythonNN.DLL as debug or release?

Hi Folks,

We've been using Python embedded in an application for a while now,
where the Python dll is PythonNN.dll, NN being the version number, such
as Python24.dll.

Recently it was pointed out to me that Python can run in a debug or
release configuration and that you can specify this on the command line
using -O and -OO.

My question is how do I specify this to the Python DLL I have embedded
in my application? Is it as straightforward as:
o Use PythonNN.dll for release mode Python
o Use PythonNN_d.dll for debug mode Python

and if so, how do I specify I want -O or -OO with release mode?

I've tried looking at the C API documentation but couldn't find anything
useful there.

We are using versions of Python from 2.2 upwards.

Cheers

Stephen
--
Stephen Kellett
Object Media Limited
Computer Consultancy, Software Development
Windows C++, Java, Assembler, Performance Analysis, Troubleshooting
Jul 19 '05 #1
2 1599
Stephen Kellett wrote:
We've been using Python embedded in an application for a while now,
where the Python dll is PythonNN.dll, NN being the version number, such
as Python24.dll.

Recently it was pointed out to me that Python can run in a debug or
release configuration and that you can specify this on the command line
using -O and -OO.


whoever pointed that out to you was confused: -O and -OO are optimization
flags used by the Python interpreter, and has nothing to do with what Python
runtime you're using.

$ python -h
usage: python [option] ... [-c cmd | file | -] [arg] ...
Options and arguments (and corresponding environment variables):
....
-O : optimize generated bytecode (a tad; also PYTHONOPTIMIZE=x)
-OO : remove doc-strings in addition to the -O optimizations
....

if you want to use these from your C code, setting the global Py_OptimizeFlag
to 1 (-O) or 2 (-OO) should work.

</F>

Jul 19 '05 #2
>-O : optimize generated bytecode (a tad; also PYTHONOPTIMIZE=x)
-OO : remove doc-strings in addition to the -O optimizations
...

if you want to use these from your C code, setting the global Py_OptimizeFlag
to 1 (-O) or 2 (-OO) should work.


Yes that is what I wanted to do. Thank you very much.

Stephen
--
Stephen Kellett
Object Media Limited
Computer Consultancy, Software Development
Windows C++, Java, Assembler, Performance Analysis, Troubleshooting
Jul 19 '05 #3

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

Similar topics

3
by: Raphael Zulliger | last post by:
Hi I have to check wheter a .py script is run within the debug or the release version of an embedded python interpreter (in short, wheter python24_d.dll or python24.dll is in use). long...
4
by: Claire | last post by:
How do I determine whether Im running in debug or release mode from code please. thanks Claire
4
by: xTroLL | last post by:
Hi, I want to get the running mode (DEBUG or RELEASE) of my application ? Somebody can help me ? xTroLL --------------= Posted using GrabIt =---------------- ------= Binary Usenet...
7
by: Wysiwyg | last post by:
Is there any way besides adding a specific debug command line argument for the project to tell if an application is running in debug mode? Thanks! Bill
3
by: Janos Makadi | last post by:
Hi, I have a very interesting problem. I wrote a little code which linked against an externel library. I have the debug, and the release version of the ext. lib. One library function opens a...
4
by: Henry Padilla | last post by:
I found the following code snippet in the help but it doesn't seem to compile. Dim debugger As EnvDTE.Debugger Dim IsDebugging As Boolean debugger = DTE.Debugger If (debugger Is Nothing)...
2
by: CtrlAltDel | last post by:
I have an ASP.NET application that runs just fine on our servers (Win2003, in dev/staging/prod) when the debug attribute of <system.web><compilation /></system.webis set to true, thusly: ...
9
by: Michael.Suarez | last post by:
Suppose I have a program that prompts you with a dialogbox to enter a password. If you get the password correct, it allows you into the program, else it kills the program. Suppose that when I...
41
by: z | last post by:
I use Visual C 2005 to develop my programs. One in particular is crashing in very specific and hard to replicate situations, made worse by the fact it only crashes when run -outside- the dev - as...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.