need help for extending and embedding

Discussion in 'Python' started by Ing Giuseppe Monteleone, Feb 29, 2004.

  1. 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
    Ing Giuseppe Monteleone, Feb 29, 2004
    #1
    1. Advertising

  2. Ing Giuseppe Monteleone

    Jeff Epler Guest

    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
    Jeff Epler, Feb 29, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luke
    Replies:
    3
    Views:
    505
    Robin Becker
    Oct 24, 2003
  2. Faheem Mitha
    Replies:
    0
    Views:
    412
    Faheem Mitha
    Jun 28, 2004
  3. Mark Harrison

    Extending and Embedding doc?

    Mark Harrison, Jul 23, 2004, in forum: Python
    Replies:
    1
    Views:
    291
    Mark Harrison
    Jul 23, 2004
  4. stefan
    Replies:
    3
    Views:
    421
    stefan
    Dec 8, 2004
  5. Eduardo Rodrigues

    Extending and Embedding

    Eduardo Rodrigues, Mar 13, 2005, in forum: Python
    Replies:
    1
    Views:
    281
    Diez B. Roggisch
    Mar 13, 2005
Loading...

Share This Page