Re: Embedded python is not 100% stable

2023-04-13 Thread aapost
On 4/13/23 03:40, Guenther Sohler wrote: Attachments are stripped, so they weren't included. Glancing at the branch and the 2 lines you mentioned. You have a comment with a link for python 2.3 documentation. Yet you have python 3.10 code included elsewhere (and openscad itself requires the

Re: Embedded python is not 100% stable

2023-04-13 Thread Dieter Maurer
Guenther Sohler wrote at 2023-4-13 09:40 +0200: > ... >I have been working on adding embedded python into OpenSCAD ( >www.openscad.org) >for some time already. For that i coded/added an additional Python Type >Object >which means to hold openscad geometric data. > >It works quite well but unfortuna

Re: Embedded python: How to debug code in an isolated way

2020-08-26 Thread Barry Scott
> On 24 Aug 2020, at 12:52, Eko palypse wrote: > > Thank you very much for your interest in my little problem. > >> When the app calls into python does the event loop of the gui block? > > Yes, the cpp app calls a callback function from the embedded python > interpreter synchronously. > >>

Re: Embedded python: How to debug code in an isolated way

2020-08-24 Thread Chris Angelico
On Tue, Aug 25, 2020 at 6:30 AM Schachner, Joseph wrote: > > Another suggestion: If your Python code only references few things outside > of itself, make a simulated environment in Python on your PC, so that you can > run your embedded code after importing your simulated environment, which >

RE: Embedded python: How to debug code in an isolated way

2020-08-24 Thread Schachner, Joseph
n.org Subject: Re: Embedded python: How to debug code in an isolated way On 2020-08-22, Chris Angelico wrote: > On Sun, Aug 23, 2020 at 5:51 AM Eko palypse wrote: >> So the question is, what do I need to read/learn/understand in order to >> solve this issue? >> Or in other

Re: Embedded python: How to debug code in an isolated way

2020-08-24 Thread Eko palypse
Thank you very much for your interest in my little problem. > When the app calls into python does the event loop of the gui block? Yes, the cpp app calls a callback function from the embedded python interpreter synchronously. > When you print does that trigger the event loop to run in a nested

Re: Embedded python: How to debug code in an isolated way

2020-08-23 Thread Grant Edwards
On 2020-08-23, Chris Angelico wrote: > On Mon, Aug 24, 2020 at 6:00 AM Grant Edwards > wrote: >> >> On 2020-08-22, Chris Angelico wrote: >> > On Sun, Aug 23, 2020 at 5:51 AM Eko palypse wrote: >> >> So the question is, what do I need to read/learn/understand in order to >> >> solve this issue

Re: Embedded python: How to debug code in an isolated way

2020-08-23 Thread Barry
> On 22 Aug 2020, at 20:53, Eko palypse wrote: > > Hello, > > background info first. On windows, python3.8.5 > > A cpp app has an embedded python interpreter which allows to modify/enhance > the cpp app > by providing objects to manipulate the cpp app and callbacks to act on > certain even

Re: Embedded python: How to debug code in an isolated way

2020-08-23 Thread Chris Angelico
On Mon, Aug 24, 2020 at 6:00 AM Grant Edwards wrote: > > On 2020-08-22, Chris Angelico wrote: > > On Sun, Aug 23, 2020 at 5:51 AM Eko palypse wrote: > >> So the question is, what do I need to read/learn/understand in order to > >> solve this issue? > >> Or in other words, how can I debug my scr

Re: Embedded python: How to debug code in an isolated way

2020-08-23 Thread Grant Edwards
On 2020-08-22, Chris Angelico wrote: > On Sun, Aug 23, 2020 at 5:51 AM Eko palypse wrote: >> So the question is, what do I need to read/learn/understand in order to >> solve this issue? >> Or in other words, how can I debug my script in an isolated environment. > > I'd go for the old standby - I

Re: Embedded python: How to debug code in an isolated way

2020-08-22 Thread Eko palypse
Thx for your tip/suggestion. > If In Doubt, Print It Out! That's the current situation and that's usually enough, but then there's this situation where it gets annoying because you realize that the print wouldn't make more sense at this point but at that point and that's where a debugger is just

Re: Embedded python: How to debug code in an isolated way

2020-08-22 Thread Chris Angelico
On Sun, Aug 23, 2020 at 5:51 AM Eko palypse wrote: > So the question is, what do I need to read/learn/understand in order to solve > this issue? > Or in other words, how can I debug my script in an isolated environment. I'd go for the old standby - IIDPIO: If In Doubt, Print It Out! Instead of t

Re: Embedded Python and multiprocessing on Windows?

2018-08-10 Thread applemask
On Friday, August 10, 2018 at 2:28:45 AM UTC-4, Léo El Amri wrote: > That may be something simple: Did you actually protected the entry-point > of your Python script with if __name__ == '__main__': ? That was my first thought too; the script technically doesn't have top-level code, so I figured I

Re: Embedded Python and multiprocessing on Windows?

2018-08-09 Thread Léo El Amri via Python-list
On 09/08/2018 19:33, Apple wrote:> So my program runs one script file, and multiprocessing commands from that script file seem to fail to spawn new processes. > > However, if that script file calls a function in a separate script file that > it has imported, and that function calls multiprocessin

Re: Embedded Python import fails with zip/egg files (v3.6.1)

2017-05-15 Thread Griebel, Herbert
Thanks eryk! It looks like I have to dig deeper and step through the Python code again to see what's going on. On 11.05.2017 15:37, eryk sun wrote: On Thu, May 11, 2017 at 9:02 PM, Griebel, Herbert wrote: 07:59:04,3205458python.exe4224CreateFile C:\Users\hansi\Downloads\python-e

Re: Embedded Python import fails with zip/egg files (v3.6.1)

2017-05-11 Thread eryk sun
On Thu, May 11, 2017 at 9:02 PM, Griebel, Herbert wrote: > > 07:59:04,3205458python.exe4224CreateFile > C:\Users\hansi\Downloads\python-emb\python36.zipSUCCESS Desired Access: > Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO > Non-Alert, Open Reparse Point

Re: Embedded Python and C Callback functions

2015-06-07 Thread dieter
doc.mefi...@gmail.com writes: > I'm trying to debug and find my error. It goes wrong when: > PyObject *v; > v = va_arg(*p_va, PyObject *); > if (v != NULL) { > if (*(*p_format - 1) != 'N') > Py_INCREF(v); > } > > it tries to

Re: Embedded Python and C Callback functions

2015-06-07 Thread Stefan Behnel
doc.mefi...@gmail.com schrieb am 07.06.2015 um 10:56: > And I can't use Cython, because I have C++ module, and I have to use it. That's not a valid reason. Cython supports C++ code just fine. http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html Stefan -- https://mail.python.org/mailma

Re: Embedded Python and C Callback functions

2015-06-07 Thread doc . mefisto
> >And I can't use Cython, because I have C++ module, and I have to use it. > >-- > >https://mail.python.org/mailman/listinfo/python-list > > Are you using Boost? > http://www.boost.org/doc/libs/1_58_0/libs/python/doc/ > > It handles lots of the setup for you. > > Laura No, I'm not using Boost

Re: Embedded Python and C Callback functions

2015-06-07 Thread Laura Creighton
In a message of Sun, 07 Jun 2015 01:56:47 -0700, doc.mefi...@gmail.com writes: >And I can't use Cython, because I have C++ module, and I have to use it. >-- >https://mail.python.org/mailman/listinfo/python-list Are you using Boost? http://www.boost.org/doc/libs/1_58_0/libs/python/doc/ It handles

Re: Embedded Python and C Callback functions

2015-06-07 Thread doc . mefisto
I'm trying to debug and find my error. It goes wrong when: PyObject *v; v = va_arg(*p_va, PyObject *); if (v != NULL) { if (*(*p_format - 1) != 'N') Py_INCREF(v); } it tries to PyINCREF to my passed callback. -- https://mail

Re: Embedded Python and C Callback functions

2015-06-07 Thread doc . mefisto
And I can't use Cython, because I have C++ module, and I have to use it. -- https://mail.python.org/mailman/listinfo/python-list

Re: Embedded Python and C Callback functions

2015-06-07 Thread doc . mefisto
No, myclass is not null. I think my style of passing arguments is wrong. -- https://mail.python.org/mailman/listinfo/python-list

Re: Embedded Python and C Callback functions

2015-06-06 Thread dieter
doc.mefi...@gmail.com writes: > Hi. I'm a newbie in python. But I want embed it in my C program. > > There is such method of my class: > @staticmethod > def install_instr_callback(callback): > # set hook for every change of PC > m68k.set_instr_hook_callback(callback) > > And in my C code t

Re: Embedded python 'scripting engine' inside Python app

2014-11-24 Thread Chris Angelico
On Tue, Nov 25, 2014 at 6:38 PM, Patrick Stinson wrote: > Thanks for the stories in this and the other thread. I love these interesting > problems that push the limits :) I agree. How boring is life when we never push the limits! ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Embedded python 'scripting engine' inside Python app

2014-11-24 Thread Patrick Stinson
> On Nov 23, 2014, at 4:57 AM, Chris Angelico wrote: > > On Mon, Nov 24, 2014 at 12:20 AM, Patrick Stinson > wrote: >> I think this is the way I’ll take it, and for all the same reasons. The only >> way they can break it is if they really want to. I guess anything other >> Franken-apps would

Re: Embedded python 'scripting engine' inside Python app

2014-11-24 Thread Patrick Stinson
I think this is the way I’ll take it, and for all the same reasons. The only way they can break it is if they really want to. I guess anything other Franken-apps would be interesting to hear about too. And I’ll still stick it on the app store. > On Nov 23, 2014, at 1:35 AM, Chris Angelico wro

Re: Embedded python 'scripting engine' inside Python app

2014-11-24 Thread Patrick Stinson
Thanks for your great reply. I even augmented the reloading with the same dict by clearing all of the non-standard symbols from the dict. This effectively resets the dict: # try to clear out the module by deleting all global refs

Re: Embedded python 'scripting engine' inside Python app

2014-11-23 Thread Chris Angelico
On Mon, Nov 24, 2014 at 12:20 AM, Patrick Stinson wrote: > I think this is the way I’ll take it, and for all the same reasons. The only > way they can break it is if they really want to. I guess anything other > Franken-apps would be interesting to hear about too. And I’ll still stick it > on t

Re: Embedded python 'scripting engine' inside Python app

2014-11-23 Thread Stefan Behnel
Chris Angelico schrieb am 23.11.2014 um 11:35: > On Sun, Nov 23, 2014 at 9:28 PM, Patrick Stinson wrote: >> Is there a better and more secure way to do the python-within-python in >> order allow users to automate your app? > > More secure? Basically no. You could push the inner script into a > sep

Re: Embedded python 'scripting engine' inside Python app

2014-11-23 Thread Chris Angelico
On Sun, Nov 23, 2014 at 9:28 PM, Patrick Stinson wrote: > Thanks for your great reply. I even augmented the reloading with the same > dict by clearing all of the non-standard symbols from the dict. This > effectively resets the dict: You may as well start with an empty dict and then pick up the f

Re: Embedded python 'scripting engine' inside Python app

2014-11-23 Thread Chris Angelico
On Sun, Nov 23, 2014 at 4:48 PM, Patrick Stinson wrote: > I am writing a python app (using PyQt, but that’s not important here), and > want my users to be able to write their own scripts to automate the app’s > functioning using an engine API hat I expose. I have extensive experience > doing th

Re: embedded python and threading

2013-07-26 Thread Stefan Behnel
David M. Cotter, 26.07.2013 19:28: > DOH! as my second thread, i had been using a sample script that i had > copy-pasted without much looking at it. guess what? it prints the time. and > yes, it did "from time import time", which explains it all. Ah, and you were using the same globals dict f

Re: embedded python and threading

2013-07-26 Thread David M. Cotter
DOH! as my second thread, i had been using a sample script that i had copy-pasted without much looking at it. guess what? it prints the time. and yes, it did "from time import time", which explains it all. thanks for the hints here, that helped me figure it out! -- http://mail.python.org/mai

Re: embedded python and threading

2013-07-26 Thread David M. Cotter
no, there is no "time.py" anywhere (except perhaps as the actual python library originally imported) did you understand that the function works perfectly, looping as it should, up until the time i run a second script on a separate thread? -- http://mail.python.org/mailman/listinfo/python-list

Re: embedded python and threading

2013-07-26 Thread John Gordon
In <965b463e-e5bf-4ccd-9a3c-b0cb964b3...@googlegroups.com> "David M. Cotter" writes: > == > 9: Traceback (most recent call last): > 9: File "", line 10, in ? > 9: File "", line 6, in main > 9: AttributeError: 'builtin_function_or_method

Re: embedded python and threading

2013-07-26 Thread David Robinow
Works for me. Except that if I then do: touch time.py I get the same error as you do. Can you figure out the problem now? On Fri, Jul 26, 2013 at 11:57 AM, David M. Cotter wrote: > okay, i have simplified it: here is the code > > == > import time > > d

Re: embedded python and threading

2013-07-26 Thread David M. Cotter
okay, i have simplified it: here is the code == import time def main(): while True: print "i'm alive" time.sleep(0.25) #- if __name__ == "__main__": main() ===

Re: embedded python and threading

2013-07-26 Thread Stefan Behnel
David M. Cotter, 26.07.2013 08:15: > in my app i initialize python on the main thread, then immediately call > PyEval_SaveThread() because i do no further python stuff on the main thread. > > then, for each script i want to run, i use boost::threads to create a new > thread, then on that thread

Re: Embedded python console and FILE* in python 3.2

2011-08-08 Thread Terry Reedy
On 8/8/2011 11:17 AM, Francis Labarre wrote: Hello everyone, I'm currentlytrying to port some embedded code from python 2.7 to python 3.2. The current code replicate the basic behavior of the python interpreter in an MFC application. When a command is entered in our embedded interpreter, we wri

RE: Embedded python console and FILE* in python 3.2

2011-08-08 Thread F L
ughthe api. I'll look into it, thank again. F.L. > Date: Mon, 8 Aug 2011 19:52:14 +0200 > From: t...@jollybox.de > To: python-list@python.org > Subject: Re: Embedded python console and FILE* in python 3.2 > > On 08/08/11 19:44, Thomas Jollans wrote: > > > > > 1

Re: Embedded python console and FILE* in python 3.2

2011-08-08 Thread Thomas Jollans
On 08/08/11 19:44, Thomas Jollans wrote: > If you use the same workflow as you do currently, it won't: > > 1. Feed input to your custom stdin object, which will buffer the code. > 2. Call PyRun_IteractiveOne - it will read from your object, which will >return the buffer contents. > 3. The resu

Re: Embedded python console and FILE* in python 3.2

2011-08-08 Thread Thomas Jollans
On 08/08/11 19:14, F L wrote: >> Is the `code` module (http://docs.python.org/library/code.html) an > insufficiently exact copy of an interpreter for you? > > The problem isn't really to emulate the behavior of the interpreter as > to obtain the result of the execution as a string in c++. > The c

RE: Embedded python console and FILE* in python 3.2

2011-08-08 Thread F L
> Is the `code` module (http://docs.python.org/library/code.html) an > insufficiently exact copy of an interpreter for you? The problem isn't really to emulate the behavior of the interpreter as to obtain the result of the execution as a string in c++. The code module doesn't seem to help with

Re: Embedded python console and FILE* in python 3.2

2011-08-08 Thread Katriel Cohn-Gordon
Is the `code` module (http://docs.python.org/library/code.html) an insufficiently exact copy of an interpreter for you? On Mon, Aug 8, 2011 at 4:17 PM, Francis Labarre wrote: > Hello everyone, > > I'm currently trying to port some embedded code from python 2.7 to python > 3.2. > > The current co

Re: Embedded python console and FILE* in python 3.2

2011-08-08 Thread Thomas Jollans
On 08/08/11 17:17, Francis Labarre wrote: > Hello everyone, > > I'm currently trying to port some embedded code from python 2.7 to > python 3.2. > > The current code replicate the basic behavior of the python interpreter > in an > MFC application. When a command is entered in our embedded interpr

Re: embedded python 2.7.1 slow startup

2011-03-08 Thread Terry Reedy
On 3/8/2011 4:06 AM, bruce bushby wrote: Hi I've been playing with running python on embedded linux. I thought I would run some "straces" to see how the install went when I noticed python attempts to "open" loads of files that don't exist.is there a way to prevent these "open" attemptsth

Re: embedded python 2.7.1 slow startup

2011-03-08 Thread Kushal Kumaran
On Tue, Mar 8, 2011 at 2:36 PM, bruce bushby wrote: > Hi > I've been playing with running python on embedded linux. I thought I would > run some "straces" to see how the install went when I noticed python > attempts to "open" > loads of files that don't exist.is there a way to prevent these "o

Re: Embedded Python static modules

2011-01-09 Thread Евгений Почитаев
I found solution: Py_NoSiteFlag = 1; Py_FrozenFlag = 1; Py_IgnoreEnvironmentFlag = 1; Py_SetPythonHome(""); Py_SetProgramName(""); -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedded Python static modules

2011-01-09 Thread Евгений Почитаев
I made frozen modules and link this modules with my program. PyImport_FrozenModules = frozen_modules; Py_Initialize(); I got next message: Could not find platform independent libraries Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] Traceback (most recent call last

Re: embedded python on mac - linking problem

2010-01-07 Thread Krzysztof Kobus
Hi, I have been able to solve the problem finally: Initially I was trying (wrongly) to link distutils-made module with my application and that has failed. Solution was to (instead of linking the module) compile the source files making up the module and link corresponding objects as any other s

Re: embedded python on mac - linking problem

2010-01-06 Thread Krzysztof Kobus
Hi, >The missing symbol looks like a C++-symbol - but Python is C. Do you maybe >miss the > extern "C" > > declaration. I have not specified extern "C" as I assume it is a part of PyMODINIT_FUNC define. At least documentation says so: "Note that PyMODINIT_FUNC declares the function as PyObjec

Re: embedded python on mac - linking problem

2010-01-06 Thread Diez B. Roggisch
Krzysztof Kobus schrieb: Hi, I have a problem with linking python module with my application on mac in order to make the module available in "embedded python". My python module is contained in j3kmodule.cxx file and module initialization function is exported in j3kmodule.h j3kmodule.h:

Re: embedded python on mac - linking problem

2010-01-06 Thread Krzysztof Kobus
Hi, > > Well, it seems that one of your files is a different architecture than > > the others. Based on the location, I'd say it's i386 while the rest of > > it would be PowerPC. You can cross-compile but you can't link an i386 > > library to a PowerPC library. Thank you for the hint. I have ch

Re: embedded python on mac - linking problem

2010-01-05 Thread Benjamin Kaplan
On Tue, Jan 5, 2010 at 7:33 AM, Krzysztof Kobus wrote: > Hi, > > I have a problem with linking python module with my application on mac in > order to make the module available in "embedded python". > > My python module is contained in  j3kmodule.cxx file and module > initialization function is e

Re: Embedded python on systems without python installed

2009-10-27 Thread Gabriel Genellina
En Tue, 27 Oct 2009 19:31:45 -0300, Stef Mientki escribió: KillSwitch wrote: I have python successfully embedded in a program I wrote. What files do I need and where do I need to put them so that it can run on systems that don't have python installed? I embed python in Delphi apps, and the

Re: Embedded python on systems without python installed

2009-10-27 Thread Stef Mientki
KillSwitch wrote: I have python successfully embedded in a program I wrote. What files do I need and where do I need to put them so that it can run on systems that don't have python installed? I embed python in Delphi apps, and the only thing I add is python24.dll, which I put in the same di

Re: Embedded python on systems without python installed

2009-10-27 Thread Stef Mientki
KillSwitch wrote: I have python successfully embedded in a program I wrote. What files do I need and where do I need to put them so that it can run on systems that don't have python installed? I embed python in Delphi apps, and the only thing I add is python24.dll, which I put in the same di

Re: Embedded Python : Why does thread lock here?

2009-07-07 Thread Gabriel Genellina
En Tue, 07 Jul 2009 15:01:17 -0300, roschler escribió: I have the Python Intepreter embedded in a Delphi (Object Pascal) program. In the Python script shown below, I have a module that creates a thread object and starts it. Do you *execute* the module or do you *import* it? Isn't a good id

Re: Embedded python 2.6 interpreter can't "import sqlite3" on Windows XP

2009-02-01 Thread Peter
jdetaeye wrote: I am porting an application which embeds a Python interpreter to Python 2.6. On version 2.5 all is working fine, but importing the sqlite3 module doesn't work any more on 2.6. The statement "import sqlite3" does work fine when executed from in the python command prompt, ie not f

Re: embedded python doesn't like socket.accept() and SegFaults

2008-08-02 Thread Riccardo Di Meo
Solved (with the help of the guys on #python on freenode). Long story short: i forgot the static in the function definitions and the libc's "accept" got replaced with mine... Riccardo Di Meo wrote: Hi everyone, I'm practicing with embedding python into C code and i have encountered a very

Re: Embedded Python Import problem

2008-06-27 Thread Benjamin
On Jun 27, 5:47 pm, sleek <[EMAIL PROTECTED]> wrote: > I am having trouble with the following code: > > PyObject *module = PyImport_ImportModule(modulename); > if (module == NULL) { > >     PyObject* et, *ev, *etr; >     PyErr_Fetch(&et, &ev, &etr); >     PyObject* traceback = PyImport_ImportModule

Re: embedded python pythonpath

2008-03-26 Thread Furkan Kuru
On Wed, Mar 26, 2008 at 3:49 AM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Tue, 25 Mar 2008 22:22:41 -0300, Furkan Kuru <[EMAIL PROTECTED]> > escribió: > > > On 3/26/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > > >> En Tue, 25 Mar 2008 20:38:39 -0300, Furkan Kuru <[EMAIL PROTECTED]

Re: embedded python pythonpath

2008-03-25 Thread Gabriel Genellina
En Tue, 25 Mar 2008 22:22:41 -0300, Furkan Kuru <[EMAIL PROTECTED]> escribió: > On 3/26/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > >> En Tue, 25 Mar 2008 20:38:39 -0300, Furkan Kuru <[EMAIL PROTECTED]> >> escribió: >> >> > Actually, I do not want any .py or .pyc files around my executabl

Re: embedded python pythonpath

2008-03-25 Thread Furkan Kuru
On 3/26/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Tue, 25 Mar 2008 20:38:39 -0300, Furkan Kuru <[EMAIL PROTECTED]> > escribió: > > > Actually, I do not want any .py or .pyc files around my executable. > > (including userdict, sys, site etc) > > I want to have just single zip file for a

Re: embedded python pythonpath

2008-03-25 Thread Gabriel Genellina
En Tue, 25 Mar 2008 20:38:39 -0300, Furkan Kuru <[EMAIL PROTECTED]> escribió: > Actually, I do not want any .py or .pyc files around my executable. > (including userdict, sys, site etc) > I want to have just single zip file for all python files. Putting all of them into pythonNN.zip (NN dependi

Re: embedded python pythonpath

2008-03-25 Thread Furkan Kuru
Actually, I do not want any .py or .pyc files around my executable. (including userdict, sys, site etc) I want to have just single zip file for all python files. I had a look at py2exe source codes but could not figure out how it just looks into a zip file. So maybe I have to compile the svn vers

Re: embedded python pythonpath

2008-03-25 Thread Gabriel Genellina
Furkan Kuru gmail.com> writes: > I've tried below code (Setting pythonpath environment variable) > and then initialize python interpreter but the embedded python interpreter did not get the newly assigned PYTHONPATH. > I ve looked at the sys.path in python code (that is run by the embedded int

Re: embedded python in c++ packaging

2008-03-25 Thread Furkan Kuru
nely control what you expose to python, so you don't > wind up exposing the whole C++ API. > > > > > > > > > > -- > *From:* Furkan Kuru [mailto:[EMAIL PROTECTED] > *Sent:* Thursday, February 07, 2008 6:06 PM > *To:* python-list@p

Re: embedded python in c++ packaging

2008-02-07 Thread Gabriel Genellina
En Thu, 07 Feb 2008 21:05:46 -0200, Furkan Kuru <[EMAIL PROTECTED]> escribió: > I do not have access to my development machine right now. > but is it enough adding just a simple line at the top of my main python > file > 'sys.path.append("modules.zip")' before importing any other modules? Alm

RE: embedded python in c++ packaging

2008-02-07 Thread Bronner, Gregory
e. I use one giant SWIG module (see init function above) SWIG allows you to finely control what you expose to python, so you don't wind up exposing the whole C++ API. From: Furkan Kuru [mailto:[EMAIL PROTECTED] Sent: Thursday, Feb

Re: embedded python in c++ packaging

2008-02-07 Thread Furkan Kuru
I do not have access to my development machine right now. but is it enough adding just a simple line at the top of my main python file 'sys.path.append("modules.zip")' before importing any other modules? On 2/7/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > En Thu, 07 Feb 2008 16:18:57 -0200

Re: embedded python in c++ packaging

2008-02-07 Thread Gabriel Genellina
En Thu, 07 Feb 2008 16:18:57 -0200, Joshua Kugler <[EMAIL PROTECTED]> escribió: > Furkan Kuru wrote: >> >> I have been developing an application in C++ that embeds Python >> interpreter. It takes advantage of too many modules from Python. >> When I want to package this application, I need to add

Re: embedded python in c++ packaging

2008-02-07 Thread Joshua Kugler
Furkan Kuru wrote: > Hello, > > I have been developing an application in C++ that embeds Python > interpreter. It takes advantage of too many modules from Python. > When I want to package this application, I need to add too many files > (.pyc) from Python/lib folder together with Python25.dll. > I

Re: embedded python in c++ packaging

2008-02-07 Thread Warren Myers
The Python byte-code files are already pretty dense, so compressing them further is unlikely to work if you try to put them in a zip. WMM On Feb 7, 2008 11:39 AM, Furkan Kuru <[EMAIL PROTECTED]> wrote: > Hello, > > I have been developing an application in C++ that embeds Python > interpreter. >

Re: Embedded Python - Blocking Python Function

2007-11-16 Thread andy
On Nov 15, 5:03 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 15 Nov 2007 16:18:45 -0300, <[EMAIL PROTECTED]> escribió: > > > On Nov 15, 9:43 am, [EMAIL PROTECTED] wrote: > >> On Nov 14, 4:20 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > >> wrote: > > >> > Not forcibly - you need som

Re: Embedded Python - Blocking Python Function

2007-11-15 Thread Gabriel Genellina
En Thu, 15 Nov 2007 16:18:45 -0300, <[EMAIL PROTECTED]> escribió: > On Nov 15, 9:43 am, [EMAIL PROTECTED] wrote: >> On Nov 14, 4:20 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> >> wrote: >> >> > Not forcibly - you need some cooperation from the Main function. Maybe >> > setting a global variable th

Re: Embedded Python - Blocking Python Function

2007-11-15 Thread andy
On Nov 15, 9:43 am, [EMAIL PROTECTED] wrote: > On Nov 14, 4:20 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > > Not forcibly - you need some cooperation from the Main function. Maybe > > setting a global variable that Main checks periodically. > > Thanks. I'll give that a try! > > Andy I

Re: Embedded Python - Blocking Python Function

2007-11-15 Thread andy
On Nov 14, 4:20 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > Not forcibly - you need some cooperation from the Main function. Maybe > setting a global variable that Main checks periodically. Thanks. I'll give that a try! Andy -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedded Python - Blocking Python Function

2007-11-14 Thread Gabriel Genellina
En Wed, 14 Nov 2007 20:02:42 -0300, <[EMAIL PROTECTED]> escribió: > The problem is that the function "Main" in the Python script can take > up to 60 seconds to execute. How can I terminate this thread (and > therefore the Main function in python) cleanly from the primary thread > of my application

Re: Embedded python adding variables linking to C++-Variables / callbacks

2006-12-07 Thread gagsl-py
On 7 dic, 11:33, "iwl" <[EMAIL PROTECTED]> wrote: > What I found out up to now is to create a class inherited from an > fitting type > and overwrite the __setitem__ and __getitem__ method but haven't test > this > yet, something like that: > > class test(int): > __setitem(self, value)__: C-Set-F

Re: Embedded python adding variables linking to C++-Variables / callbacks

2006-12-07 Thread iwl
[EMAIL PROTECTED] schrieb: > > Write some C functions -callable from Python- which will be used to get > and set the variable value. > >From inside Python, declare a property with getter and setter which > will call your C functions. > This works fine for object attributes. If you want to trap ref

Re: Embedded python adding variables linking to C++-Variables / callbacks

2006-12-07 Thread gagsl-py
iwl ha escrito: > I would like to add Variables to my embedded python which represents > variables from my > C++-Programm. > I found C-Api-funcs for adding my C-Funcs to python but none to add > variables. > I would like some C-Function is called when the added Python-varible is > set (LValue) and

Re: Embedded python loading .so files?

2006-10-26 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > I realize that this should include a ('.so','rb',3) entry (should it > not? 3->imp.C_EXTENSION) if it were going to locate the c extension. > Thus, my revised question would be what sets the suffixes for import? > How do/Can I change this? It depends on the target supp

Re: Embedded python loading .so files?

2006-10-26 Thread jefishman
> You really need to do some debugging here. There must be more error > message than that, or there are some issues with libdl on the target > system. A common problem is that it gives an error message that > some symbols could not be found when loading the shared library, > and that these symbols

Re: Embedded python loading .so files?

2006-10-25 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > However, I would like to be able to import this package dynamically > within the application running on the host machine. When I attempted > to import the package within the already loaded python modules, I would > get errors that the C portions of the package could no

Re: embedded Python calling app via COM

2006-06-23 Thread Jim
> Pythoncom.GetActiveObject will retrieve the running instance of the app. Thanks Roger, that does seem to do the trick. I haven't tested to see what happens if there are two instances of the app running, I'm hoping it will return the frontmost visible one. -- Jim -- http://mail.python.org/m

Re: embedded Python calling app via COM

2006-06-22 Thread Roger Upole
"Jim" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have a C++ app which fires up a Python script using C API calls. > That script operates the app via Automation calls, like this: > > from win32com.client import * > from mywrapper import * > > myapp = Application() > myapp.Visibl

Re: embedded python and windows multi threading, can't get it to work

2006-06-13 Thread Serge Orlov
freesteel wrote: > I am trying to run a python programme embedded from C++. I want to run > the same python code concurrently in several threads. I read the manual > on embedding, especially chapter 8, and searched for relevant info on > google all afternoon, but I can't get this to work. What am I

Re: Embedded Python

2006-03-10 Thread Fredrik Lundh
John Dean wrote: > Is it possible to execute a whole script using the C API function > PyRun_String? At moment I load the script into a buffer. Then I get each > line of the script and pass it PyRun_String. This seems very inefficient. It > would be more efficient if I could pass the complete stri

Re: Embedded Python interpreter and sockets

2005-11-22 Thread wahn
Hi, actually that didn't solve the problem. As soon as you do something with the socket module it fails. Well, the solution I came up with is simply link the ../_socket.so into my Houdini plugin DSO which is ugly but solves the problem for the moment ... Happy hacking, Jan -- http://mail.pytho

Re: Embedded Python interpreter and sockets

2005-11-22 Thread wahn
Hey Chris, I fixed the problem in another way (don't ask me why that works). One detail I didn't talk about is that I use the Boost.Python library. So I just made sure that I load the socket module before I import my own Python script (using that socket module): ... object main_module((handle<>

Re: Embedded Python interpreter and sockets

2005-11-22 Thread wahn
Hi Chris, Thanks for your help. I'll try that ... Cheers, Jan -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedded Python interpreter and sockets

2005-11-18 Thread [EMAIL PROTECTED]
Hi Jan, I believe the problem lies with how Houdini uses dlopen() to open your plugin. It uses RTLD_LOCAL to load your plugin, which means that all your plugin's symbols (including the python symbols) are private to that library. Subsequent dlopen() calls, including those made by the python libr

Re: Embedded Python interpreter, runtime libs, and crashing

2005-10-25 Thread jussij
> It all runs great in the "Debug" configuration, but > everything gets scary when I switch to "Release". My suggestion would be to turn on debug information for the release build. That would at least let you run the release build inside the debugger, allowing you to see the call stack of the off

Re: Embedded Python - Sharing memory among scripts, threads

2005-10-24 Thread adsheehan
Any ideas? -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedded python

2005-08-04 Thread nico
Chris Johns a écrit : > nico wrote: > >> >> Does anyone have embedded a python interpreter on a proprietary >> hardware ? > > > Yes, http://www.cybertec.com.au/microcore.htm > >> I have a home made hardware running a home made OS. C is used as >> programming >> language. I'd like to add a pyt

Re: Embedded python

2005-08-04 Thread Chris Johns
nico wrote: > > Does anyone have embedded a python interpreter on a proprietary hardware ? Yes, http://www.cybertec.com.au/microcore.htm > I have a home made hardware running a home made OS. C is used as programming > language. I'd like to add a python interpreter to my system. > Any guidelines

Re: embedded Python

2005-05-25 Thread Sébastien Ramage
PROBLEME RESOLU j'ai résolu le problème en supprimant le commutateur \GZ de le link http://support.microsoft.com/kb/q191669/ -- http://mail.python.org/mailman/listinfo/python-list

Re: embedded python example: PyString_FromString doesnt work?

2005-03-25 Thread David Harris
On Fri, 25 Mar 2005 11:09:35 +0300, Denis S. Otkidach wrote: > DH> Calling the program gives an error; > DH> "[EMAIL PROTECTED]:~/source/python> ./test_String script1.py multiply 4 > DH> 5 import went bang... > DH> ImportError: No module named script1.py" > DH> script1.py exists and it is in the

  1   2   >