-1

我正在阅读用 python 自动化无聊的东西,当我在终端中运行程序时,它不会提示输入。我想提供多行作为输入。我怎样才能做到这一点?

4

1 回答 1

1

书中的示例希望您在运行程序时提供输入,例如,

python foo.py username password

如果您想在运行时收到提示,请在脚本中使用类似下面的内容,

username = input("enter your username")
password = input("enter your password")

然后使用 pyperclip 复制

pyperclip.copy(username)
于 2017-06-30T11:25:16.340 回答