首页 > 解决方案 > 有没有办法从你的代码中响应 input() ?

问题描述

我最近制作了一个 python 包,现在我正在制作一段代码来自动化更新包的过程。在我的代码中,我这样做:

os.system('twine upload --repository-url https://upload.pypi.org/legacy/ dist/*')

当我的代码执行该行时,它会说Enter your username:并且我想响应__token__该输入提示。

有没有办法做到这一点?

标签: pythonpython-3.x

解决方案


推荐阅读