使用Python代码连续读取背景C程序的控制台输出
我在Linux系统上,我的交流代码正在从连续计算中输出数据, 我想在背景中运行此代码,并从Python代码中解析此数据。 Python代码将是前景中的代码。 我在想这样的事情:(
>mycode &
>python3 mypythoncode
“>”是Linux提示) 但是这种方法很好吗? Python代码相同的相应代码是什么?
I am on linux system ,I have a c code which is outputting data from a continuous calculation,
I want to run this code in background and parse this data from a python code. Python code will be the one in the foreground.
I was thinking something like this :
>mycode &
>python3 mypythoncode
(">" is the linux prompt)
but is this approach fine? what will be the corresponding code for the same for python code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我弄清楚了:
我的C代码:
我的Python代码
输出:
OK i figured it out :
My c code :
My Python code
Output :