Re: Reentrancy of Python interpreter

2007-10-01 Thread Brad Johnson
Hrvoje Niksic xemacs.org> writes: > > Brad Johnson ballardtech.com> writes: > > > I have a place where I execute a Python command that calls into C++ > > code which then in turn calls back into Python using the same > > interpreter. I get a fatal erro

Re: Reentrancy of Python interpreter

2007-10-01 Thread Brad Johnson
yahoo.com> writes: > Looks like ( from PyThreadStage_Get error ) that you lost the GIL. You > probably > entered some C++ code and encapsulated you're work in the > > Py_BEGIN_ALLOW_THREADS > > Py_END_ALLOW_THREADS > > but you're is calling back the Python function, and you forgot > to acqui

Reentrancy of Python interpreter

2007-09-28 Thread Brad Johnson
I have embedded a single threaded instance of the Python interpreter in my application. I have a place where I execute a Python command that calls into C++ code which then in turn calls back into Python using the same interpreter. I get a fatal error which is "PyThreadStage_Get: no current thread.

Multiline command line parsing

2007-09-18 Thread Brad Johnson
I am implementing a Python command line from scratch in a Win32 application. Examples online ("How do I tell incomplete input from invalid input" in the Extending and Embedding Python FAQ) show how to implement this from scratch using C code. The examples don't work. This brief snippit illustrate

Re: IDE for Python

2007-08-21 Thread Brad Johnson
Joel Andres Granados gmail.com> writes: > > Hello list: > > I have tried various times to use an IDE for python put have always been > disapointed. Not sure which platform you're on, but I've really liked PyScripter for the Windows platform. -- http://mail.python.org/mailman/listinfo/python

Re: win32 question in Python

2007-07-30 Thread Brad Johnson
Cappy2112 gmail.com> writes: > > > Hello Brad, > > If you don't get a reply here, there is a win32 specific Python list > on ActiveState.com wher ethey do talk about excel & other Win32 python > issues. > Thanks, but I believe this you meant to address the OP Shun-Hsien, not me. Just wanted

Re: win32 question in Python

2007-07-30 Thread Brad Johnson
Huang, Shun-Hsien ercot.com> writes: > but how do I copy a excel file into > database table by using Python? > I'm not sure if this helps, but you can access the Excel Automation model very easily with: import win32com.client x1 = client.Dispatch("Excel.Application") Now you can use the x1

Utilizing a raw IDispatch Pointer from Python

2007-07-30 Thread Brad Johnson
I have a C++ application that creates a collection of COM objects. I would like to give the Python interpreter access to these interfaces that were created in C++ land. Stated another way, how can I have Python consume a IDispatch pointer from C++ and wrap it with one of those nice Python classes

Re: Problem embedding in small Win32 App

2007-07-27 Thread Brad Johnson
Gabriel Genellina yahoo.com.ar> writes: > > By far, the most common problem extending/embedding Python is to do wrong > reference counts. > Read http://docs.python.org/ext/refcounts.html again (I hope you already > did!) and make sure you don't hold a pointer to an object without > increme

Problem embedding in small Win32 App

2007-07-27 Thread Brad Johnson
stdout object (for a print statement). The pointer appears to be valid, but all of the data has overwritten with 0xDBDBDBDB, with obvious consequences. Thanks for your help in advance. ~Brad Johnson -- http://mail.python.org/mailman/listinfo/python-list

Problem Embedding Python in small Win32 App

2007-07-26 Thread Brad Johnson
. The pointer appears to be valid, but all of the data has overwritten with 0xDBDBDBDB, with obvious consequences. Thanks for any help. ~Brad Johnson -- http://mail.python.org/mailman/listinfo/python-list