【问题标题】:How to capture input prompt from command that is run thru Python如何从通过 Python 运行的命令中捕获输入提示
【发布时间】:2019-03-27 02:36:33
【问题描述】:

我有一个 Perl 脚本,提示用户输入“Enter”。我需要通过 Python 运行这个 perl 脚本。如何向用户显示提示消息或捕获提示并通过 Python 将输入值发送到 Perl?

【问题讨论】:

标签: python python-2.7


【解决方案1】:

看来你想使用输入原生python函数。

x = input('Please input your input') # this will prompt the user to type

现在您可以将输入用于您的 perl 脚本。这仅回答了您的部分问题,因为这只是捕获提示并将其发送到 perl。

你也可以在 python 中执行 perl 脚本: 您可以在这里找到更多答案:Call Perl script from Python

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2021-07-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-05-05
  • 1970-01-01
  • 2021-09-26
相关资源
最近更新 更多