import subprocess
path = '/home/test/net.keystore'
text = subprocess.Popen(['keytool', '-list', '-v', '-keystore', path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
file = text.stdout.read().decode().splitlines()
print file
Run Code Online (Sandbox Code Playgroud)
通过子进程我试图获取密钥库证书详细信息我不知道密钥库的密码。如果我按两次“输入键”,则输出正在处理
有没有办法在python中自动执行“输入键”?
您可以使用keyboard可以使用pip命令安装的模块python -m pip install keyboard。
以下代码将按回车键:
from keyboard import press
press('enter')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
33306 次 |
| 最近记录: |