hi to all
i want to use c program in python
or in other way i want to run c program from python

Run an external program from within Python code with
subprocess.call(["program-name", "arg1", "arg2"])
rather than os.system("program-name arg1 arg2")
since os.system() does not allow the Python program
to run in the background, whereas subprocess does.

Example ...

# play a midi file with a small external midiplayer:
# from http://www.kanatachoralsociety.ca/memberscorner/AKoffPlr.exe
# mplayer2.exe works too, but not wmplayer.exe
import subprocess
subprocess.call(["C:/Midi_stuff/AKoffPlr.exe", "DaarG.mid"])
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.