proc = subprocess.Popen(['start'],stdin=subprocess.PIPE,stdout=subprocess.PIPE)
proc.stdin.write('issue commands')
proc.stdin.write('issue more commands')
output = proc.stdout.read() # Deadlocked here
# Actually I have more commands to issue here
Run Code Online (Sandbox Code Playgroud)
我知道communic()可以给我一个解决这个问题的方法,但我想稍后发出更多的命令.但是communication()有点关闭子进程.
这有什么知道的工作吗?我正在尝试使用python包装器与路由器进行交互.所以我有更多的命令出现,也可以产生一些输出.在那种情况下,如何在不终止子进程的情况下进行读取.
我正在尝试在DeepLearning任务中完成一些作业[ deeplearning.ai由Andrew NG博士(斯坦福大学)].
当我在Coursera平台上尝试分配时,一切正常,但是,当我尝试imports在我的本地机器上执行相同操作时,它会给我一个错误,
ModuleNotFoundError: No module named 'lr_utils'
我已尝试通过安装解决问题lr_utils但无济于事.
网上没有提到这个模块(让我感到有些惊讶),现在我开始怀疑这是否是专有的deeplearning.ai?
或者我们可以用任何其他方式解决这个问题!