[Tutor] [tutor] Calling python from a c program

Kent Johnson kent37 at tds.net
Sun Jan 20 15:24:51 CET 2008


Varsha Purohit wrote:
> I got the python.h file but i am getting linking errors for my program....

It might help to tell us
- what platform you are using
- what compiler
- what link errors

Kent

> 
> On Jan 20, 2008 1:18 AM, Varsha Purohit <varsha.purohit at gmail.com 
> <mailto:varsha.purohit at gmail.com>> wrote:
> 
>     Hi,
>        I just read about how to call python from a c program. This is
>     the function for that
> 
>     int main()
>     {
>          Py_Initialize();
>         PyRun_SampleString("print 76");
>         Py_Finalize();
>        
>         return 0;
>     }
> 
> 
>     But i am getting an error of header file. python.h not found. Can
>     anybody tell me where can i get this header file ?? And how can i
>     call the python interpreter screen from c program ??
> 
>     -- 
>     Varsha Purohit,
>     Graduate Student 
> 
> 
> 
> 
> -- 
> Varsha Purohit,
> Graduate Student
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list