Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 这个子流程代码是做什么的?_Python - Fatal编程技术网

Python 这个子流程代码是做什么的?

Python 这个子流程代码是做什么的?,python,Python,有人能告诉我这些代码行是做什么的吗 ok = subprocess.call(["find_info", image, json_file]) if ok == 0: with open(image, "rb") as test: string = test.read() 我已经阅读了Python中用于执行shell命令的子进程,但是,我不确定它在这种上下文中的

有人能告诉我这些代码行是做什么的吗

ok = subprocess.call(["find_info",
                          image,
                          json_file])

if ok == 0:
     with open(image, "rb") as test:
         string = test.read()
我已经阅读了Python中用于执行shell命令的子进程,但是,我不确定它在这种上下文中的作用。

该模块用于执行外部程序,而不仅仅是shell命令

在本例中,它使用两个参数调用程序
find_info
,等待它完成并返回程序的返回值


我已经添加了一个链接到。在使用Python编程时,您可能希望将该文档放在手边。

它运行一个名为“find_info”的命令或shell脚本,其中包含两个参数:image和json_file(两者都可能是文件名)。然后,如果find_info成功(返回0),它将读取图像


find_info可能是$PATH或python脚本所在目录中的shell脚本或程序。

页面上没有查找_info的参考,因此它从何处加载此问题?@Spike程序
文件_info
是一个外部程序。不是Python函数。