I am running a simple C program that takes inputs from user from the console and does required operation. So I would want to automate the process.Rather than the user feeding the input,is there a way where a python script can call these values(user feed) from a list and help run the C program.
Asked
Active
Viewed 406 times
0
-
1Have you tried anything?? – Hackaholic Sep 03 '15 at 07:02
-
1Yes there are ways to run external programs from a Python script, and write to them like a file to write to the externals standard input, and read from its standard output. [Read about the `subprocess` module](https://docs.python.org/3/library/subprocess.html#module-subprocess). – Some programmer dude Sep 03 '15 at 07:08
-
1possible duplicate of [Executing a C script in python?](http://stackoverflow.com/questions/4376397/executing-a-c-script-in-python) – Pooja Nilangekar Sep 03 '15 at 08:02
-
I haven't tried,because I do not know how to approach the problem.I will surely go through the subprocess module.Thank you all.Any more ideas are most welcome. – newbie_in Sep 03 '15 at 08:11