shantanu
shantanu

Reputation: 2418

Communication between python and C

I have a command line program developed in c. Lets say, i have a parser written in C. Now i am developing a project with gui in python and i need that parser for python project. In c we can invoke a system call and redirect the output to system.out or a file. Is there are any way to do this python? I have both code and executable file of c program. Thanks in advance.

Upvotes: 0

Views: 2130

Answers (2)

luke14free
luke14free

Reputation: 2539

Sure you can, go for a subprocess. Docs are here: http://docs.python.org/library/subprocess.html#module-subprocess

Upvotes: 1

Burhan Khalid
Burhan Khalid

Reputation: 174614

To call other programs and interact with them use the subprocess module.

Upvotes: 1

Related Questions