要在调用 liteapp_ios.py 的同时打印出 Python 的 print 语句,可以在调用命令中加入 '-u' 参数,表示以无缓冲的方式运行 Python 程序。示例如下:

sh liteapp_ios.py -u | python -u -c 'import sys; print(sys.stdin.read())'

这个命令会先以无缓冲的方式运行 liteapp_ios.py,然后将其输出作为标准输入传递给 Python 程序,在 Python 程序中打印出来。注意,Python 程序也需要以无缓冲的方式运行,因此也需要加上 '-u' 参数。

如何在 .sh 脚本中调用 liteapp_ios.py 并实时输出 Python 打印内容

原文地址: https://www.cveoy.top/t/topic/oodR 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录