[Tutor] Executing a C Program from RH Linux in Python for Win
Alan Gauld
alan.gauld at btinternet.com
Thu Mar 19 10:12:04 CET 2009
"Wayne Watson" <sierra_mtnview at sbcglobal.net> wrote
> If you can execute a C program compiled on a Linux with SWIG,
> then that's what I'm looking for.
Nope, you need the suprocess module not SWIG.
What SWIG does (fairly easily!) is allow you to build a wrapper
around your C program that python can import and call the C
functions like normal Python code. I don;t think you want that,
you just want to run the program.
What you haven't made clear yet is whether you need to get
your program to interact with the C program or whether you
just want to run the executable with no interaction. (This is
much easier obviously!)
See my OS topic for various solutions to this.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
More information about the Tutor
mailing list