[Tutor] [tutor] Calling python from a c program
varsha.purohit at gmail.com
Sun Jan 20 19:00:44 CET 2008
I am gettng following linking errors....
[Linker error] undefined reference to `_imp__Py_Initialize'
[Linker error] undefined reference to `PyRun_SampleString'
[Linker error] undefined reference to `_imp__Py_Finalize'
I think i need to set the path to the linker... may be i need to pass
linking options of python to the c compiler... but wat are those options :(
On Jan 20, 2008 7:16 AM, Alan Gauld <alan.gauld at btinternet.com> wrote:
> "Varsha Purohit" <varsha.purohit at gmail.com> wrote
> > I just read about how to call python from a c program.
> Where did you read it? There are several sources of info
> on embedding Python in C, some better than others.
> > And how can i call the python interpreter screen
> > from c program ??
> You don't call the python interpreter screen
> (ie the >>> prompt) from C you call the interpreter itself.
> The interactive interpreter is a C program in its own right.
> You could write your own fairly easily or you could use
> the PyShell GUI component that is part of the wxPython
> But usually you just want to interpret some Python
> commands much as you did in your example.
> Alan Gauld
> Author of the Learn to Program web site
> Tutor maillist - Tutor at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor