473,778 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
+ 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 1617
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
3294
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 version: I'm using ctypes to load my own dll. There exists 2 version of this dll - a debug and a release version (where one is linked against debug C runtime dll and the other to release C runtime dll). Now I have to change the name of the dll I want...
4
15073
by: Claire | last post by:
How do I determine whether Im running in debug or release mode from code please. thanks Claire
4
1757
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 downloading made easy =--------- -= Get GrabIt for free from http://www.shemes.com/ =-
7
21364
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
1408
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 file which is in the same path as the executable. I copyed the file into the Debug, and the Release directoryes too. Starting the program directly from the folders (Debug, Release) causes no problem. When I start it with CTRL+F5, in any...
4
22317
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) Then MsgBox("Debugger doesn't exist! Fatal error.")
2
1626
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: <system.web> <compilation defaultLanguage="c#" debug="true" /> </system.web> However, set the attribute to false, so that pages are built as Release quality, and the page, which a moment ago was running just fine, falls flat
9
7835
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 am in Visual Studio, running the program in debug mode, i want to bypass the password prompt because if i am the developer, i am definately allowed to use the program. I assumed that I could use the this.DesignMode property while in my main...
41
2478
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 an exe, not from the Debug option. If I try to launch the debug on the crashing program, it'll close before the debugger opens. Any suggestions as to how I should proceed? Thanks in advance.
0
9629
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10127
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9923
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8954
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7474
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6723
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5370
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4031
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 we have to send another system
3
2863
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.