extending and embedding python and c
Ngoc
edo4 at emich.edu
Fri Feb 14 00:28:16 EST 2003
Just <just at xs4all.nl> wrote in message news:<just-9C902B.23344012022003 at news1.news.xs4all.nl>...
> In article <99457f2.0302121211.4967ce40 at posting.google.com>,
> edo4 at emich.edu (Ngoc) wrote:
>
> > I write a small C dll module to return string. A python script and C
> > main program. C embedding python, and python script extending to c
> > function (writen in dll)
> > When I run python script, the result is fine.
> > When I attempt to run C main program, I get the module import error
> > message.
> > I set the PYTHONPATH enviroment to my module folder. What else do I
> > need to set? I'm a new learner in python. I just try to use python
> > as interface between c function call. Please help!! Step by step.
>
> I don't think we can help without knowing more details. However,
> regarding embedding and extending, this article is quite interesting,
> although perhaps a bit extreme (but then again, it's labeled as a
> rant...):
>
> http://twistedmatrix.com/users/glyph/rant/extendit.html
>
> Just
Thank you for your reply
Yes, the article is interesting but it does not show how to tweak the
setting.
I use VC++ to write the myHello.dll in which just return "hello"
string.
Very simple one just for testing embedding and extending python in C.
Then I write the python script import myHello, a function that call
printHello from myHello.dll. I write an Test.exe (using C) in which
call python script to get "hello" string.
If I run the script on Dos prompt, I get the "hello" string.
If I run test.exe, I got "import module not found error message."
However, I test.exe program did call python script, but why python
script can not import myHello module.
I put myHello.dll in the same folder with python script.
I set PYTHONPATH to that folder.
I am missing something in the setting, but don't know how and where to
set it.
Ngoc
More information about the Python-list
mailing list