need help for extending and embedding

  • Thread starter Ing Giuseppe Monteleone
  • Start date
I

Ing Giuseppe Monteleone

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
 
J

Jeff Epler

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top