我正在用Python3编写一个生成subprocess.call的脚本,该调用要求用户编写一个密码。我希望脚本调用子进程,然后自动写入密码,但到目前为止还没有成功。我正在Linux机器上执行它,如果它有任何帮助的话。我已经尝试过Popen和Pipe
p = Popen("Command that when executed requires me to input a password", shell=True,stdin=PIPE) p.stdin.write(PASSWORD.en
# first we will import the subprocess module# running the 1st cmd command using subprocess.check_output
data = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decod
我有一个PyQt5程序,在该程序中,我使用QInputDialog窗口获取一些PCI操作的用户密码。我看不出如何获得由sudo运行的命令的输出。john@d10shop:~/bin$ python3[GCC 8.3.0] on linux
Type"help", "copyright", "credits" or "license" for more information.