From 7206a32990472dbb1356b7e5f68ecd47930729fc Mon Sep 17 00:00:00 2001 From: 622ff545dfef6c4fdb84ccec <622ff545dfef6c4fdb84ccec@devide> Date: Wed, 24 May 2023 03:48:00 +0000 Subject: [PATCH] Wed May 24 03:48:00 UTC 2023 inscode --- stui.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stui.py b/stui.py index ba1dc3a..49f2a07 100644 --- a/stui.py +++ b/stui.py @@ -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) -- GitLab