Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > need help for extending and embedding

Reply
Thread Tools

need help for extending and embedding

 
 
Ing Giuseppe Monteleone
Guest
Posts: n/a
 
      02-29-2004

I'm trying to extend and embed the python language in a Borland C++Builder
application but I have some problem

Using PyRun_SimpleFile() I got and invalid access error, menwhile using
PyRun_SimpleString I cannot have no effect.

I used the standard sequence embedding code

Py_Initialize()

Py_InitModule()
PyImport_AddModule()
PyRun_SimpleFile()

I checked parameter many times, but the program won't work. what's wrong ?

In my opinion i think that could be some problem with stdion and stdout but
I acnnot redirect them from C before starting file with PyRun_SimpleFile.


can anyone help me ?

Thanks

Ing Giuseppe Monteleone





 
Reply With Quote
 
 
 
 
Jeff Epler
Guest
Posts: n/a
 
      02-29-2004
Here's a paragraph from the Python API manual addressing this subject:
Note also that several of these functions take FILE* parameters. On
particular issue which needs to be handled carefully is that the FILE
structure for different C libraries can be different and incompatible.
Under Windows (at least), it is possible for dynamically linked
extensions to actually use different libraries, so care should be
taken that FILE* parameters are only passed to these functions if
it is certain that they were created by the same library that the
Python runtime is using.
-- http://python.org/doc/current/api/veryhigh.html

Jeff

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extending and Embedding Eduardo Rodrigues Python 1 03-13-2005 03:25 PM
after embedding and extending python (using swig) problem importing (non-core) modules stefan Python 3 12-08-2004 07:11 PM
Extending and Embedding doc? Mark Harrison Python 1 07-23-2004 09:30 PM
embedding and extending issues (with Boost.Python) Faheem Mitha Python 0 06-28-2004 06:44 PM
extending and embedding python with C# Luke Python 3 10-24-2003 04:43 PM



Advertisments