如何直接从代码向 input() 内置函数写入内容
当 input() 等待填充时,我需要直接从代码填充标准输入。 下一步是否要做:
# Here suppose to be some code that will automatically fill input() below
string = input("Input something: ")
# Or here
我听说过 subprocess.Popen,但我不明白如何在我的情况下使用它。谢谢。
I have a need to fill stdin from code directly when input() is waiting for filling.
Is there to do the next:
# Here suppose to be some code that will automatically fill input() below
string = input("Input something: ")
# Or here
I've heard about subprocess.Popen, but I don't understand how to use it in my case. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这段代码是这样的:
This code is something: