通过Python执行C代码 [英] Execute C code through Python
本文介绍了通过Python执行C代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
执行编译的C"命令的最简单,最快捷的方法是什么?
line interface"程序通过Python?
What''s the easiest and quickest way to execute a compiled C "command
line interface" program THROUGH Python?
推荐答案
Ernesto写道:
Ernesto wrote:
什么是最简单快捷的方法执行编译的C命令行/接口程序通过Python?
What''s the easiest and quickest way to execute a compiled C "command
line interface" program THROUGH Python?
我不知道你的意思是什么。但子进程,popen2和
os-modules处理调用其他程序。按顺序尝试它们。
Diez
I don''t know what you mean by THROUGH. But the subprocess, popen2 and
os-modules deal with calling other programs. Try them in that order.
Diez
导入子流程
subprocess.call(" cmd
import subprocess
subprocess.call("cmd")
谢谢。任何人都可以通过python解释器提供使用* subprocess *运行
helloWorld.C的示例。
Thanks. Can anyone provide an example of using *subprocess* to run
helloWorld.C through the python interpreter.
这篇关于通过Python执行C代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文