Patxi Bocos wrote:
Hi!,

I am developing a Python application and I need to call a C program which
needs one parameter and it returns another one.

How could I do it?

Thanks :)

You don't specify your python version, nor your OS. And you don't really say what state that C program is in.

So I'll guess you're programming in Python 2.6, on Windows, and want to "call" an existing EXE file that happened to have been written in C, but which you don't want to modify. Further, I'll assume the program is written to take its input from stdin, and outputs to stdout.

Use the subprocess module to run the EXE file. You can supply a stream for stdin, and can capture stdout.

DaveA

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to