【发布时间】:2021-10-26 15:00:17
【问题描述】:
我有一个带有 webhost、用户名和密码变量的 python 脚本,我试图将其传递给同一个 python 脚本中的 shell 命令。
output = subprocess.check_output(['curl -s -G -u username:password -k \"https://webhost/something/something\"'], shell=True, encoding='utf-8')
你能帮我怎么做吗?我尝试了多种方法,但都没有奏效。
谢谢
【问题讨论】:
标签: python python-3.x bash shell command-line-interface