473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

need help for extending and embedding


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

Jul 18 '05 #1
1 1156
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

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Luke | last post by:
does anybody know anything about pythons ability to act as a wrapper for C#? I'm having a hard time finding out about this. Any clues are appreciated.
1
by: Mark Harrison | last post by:
Is the document Extending and Embedding the Python Interpreter http://www.python.org/doc/current/ext/ext.html easily available in any other form? Pointers to either PDF or a single web page...
4
by: Alicia Haumann | last post by:
I accidentally sent this to webmaster@python.org, so this could be a duplicate if "webmaster" forwards it to this list. :{ Hi, there. Thanks for any help that can be offered. I've been...
3
by: stefan | last post by:
Hi Folks, I currenty extended some of my C++ functionality to python and also embedded python to use python functionality in my C++ system (and use as well these extended functions). While...
1
by: Mikin von Flap | last post by:
I'm trying to embed Python in a Windows exe, and extend it with some functions in the same program. So far I only add one function: <file.h> static PyObject* py_print( PyObject* self, PyObject*...
1
by: Richard Townsend | last post by:
In the "Extending and Embedding" part of the Python documentation: section 5.4 "Extending Embedded Python" - it describes how to use a Python extension module from Python that is embedded in a C...
3
by: Marco Meoni | last post by:
Hi all! I've a problem with a C++ class that has to be included in a python application. One way to do it is Extending and Embedding the Python Interpreter Now i have 2 questions 1) Is there a...
1
by: jeremito | last post by:
I am trying to learn how to extend and/or embed Python. I have looked at the document "Extending and Embedding the Python Interpreter" and also "Python/C API Reference Manual. In the examples...
3
by: dmoore | last post by:
Hi Folks: I have a question about the use of static members in Python/C extensions. Take the simple example from the "Extending and Embedding the Python Interpreter" docs: A simple module...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.