|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hi,
I'm trying to wrap my head around piping in C - I've got a small C program that forks and pipes stuff from the child process to the parent process. Currently the child process calls a C program that squirts out random numbers which then pipes the result to the parent process. The parent process reads the pipe and simply prints the random number. What I would like to do is then use this piped integer in a python program. So firstly I think I have to include the python library within the C program. #include <python2.4/Python.h> then call python with: Py_Initialize(); But when I call this the gcc compiler gives me the error: undefined reference to 'Py_Initialize' So I'm guessing that the header file I'm using is incorrect..? the python version I'm using is: Python 2.4.3 (#1, Jun 13 2006, 16:41:18) Thanks. |
| Sponsored Links |
|
|
|
|||
|
Hmmn, no I wasn't linking it on the command line with gcc.
I tried the example you gave. :\gcc pipe.c -lpython2.4 and voila! My code is not working, but at least I can see it's getting past that darn udefined variable problem. Now all I need to do is figure out how to print the variable in python with PyRun_SimpleString( ..... ). Thanks. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to learn Python. | Sir_Rimo | Python | 21 | 08-22-2008 08:16 AM |
| Python for developing software | Kasper | Python | 8 | 08-06-2008 11:11 PM |
| Python Visual Interface | Midnight | Python | 6 | 04-19-2008 12:56 AM |
| Splitting Strings with Empty Separator (Python) | Matt | Python | 3 | 05-18-2007 12:27 PM |
| Python Collection | reachpradeep | Python | 1 | 03-03-2007 02:50 PM |
| Xav | ........ | 1024.41 |
| MeTh0Dz|Reb0rn | ........ | 974.08 |
| morefood2001 | ........ | 850.04 |
| John | ........ | 841.93 |
| WingedPanther | ........ | 661.52 |
| marwex89 | ........ | 575.59 |
| Brandon W | ........ | 447.93 |
| chili5 | ........ | 292.12 |
| orjan | ........ | 187.41 |
| Steve.L | ........ | 181.88 |
Goal: 100,000 Posts
Complete: 79%