Wed May 24 03:48:00 UTC 2023 inscode

上级 92199749
......@@ -22,8 +22,7 @@ if user_input != '':
# 判断是否已安装dig
try:
subprocess.check_output(['which', 'dig'])
print('dig is already installed')
ret =subprocess.check_output(['which', 'dig'],shell=True)
except subprocess.CalledProcessError:
print('dig is not installed')
# 判断操作系统,执行相应的安装命令
......@@ -33,7 +32,7 @@ if user_input != '':
subprocess.call(['apt-get', 'install', '-y', 'dnsutils'])
else:
print('Unknown operating system')
# 使用subprocess运行dig命令并获取输出
result = subprocess.run(["dig", "+noall", "+answer", user_input ], capture_output=True)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册