问题描述
我已经在我的android项目中包装了一个静态已编译的python,然后执行了python脚本(网络服务器),程序运行正常,但是我无法读取输出/错误流,因此我已经执行了python3.4 -h
程序很好的阅读。
Process process = Runtime.getRuntime().exec(commandLine, envp,cwd);
readStream(process.getInputStream());
readStream(process.getErrorStream());
process.waitFor();
readStream()
打开一个新线程,可能是什么问题?
1楼
问题出在python的缓冲stdout和stderr上,我刚刚添加了python3.4 -u
来解决该问题,请参阅