diff --git a/stui.py b/stui.py index 6cc56d10c11b511ec664e73ba0df2bb85cc60777..e2c493a10cfc412647b16f42da8d6ffb04df12b3 100644 --- a/stui.py +++ b/stui.py @@ -1,13 +1,24 @@ import streamlit as st +import subprocess # 创建一个标题 -st.title('My First Streamlit App') +st.title('Python 解析域名IP地址') # 创建一个文本框并接收用户输入 -user_input = st.text_input('Enter your name') +user_input = st.text_input('输入域名http://') # 判断用户是否有输入,并输出一句问候语 if user_input != '': - st.write('Hello,', user_input, '!') + st.write('正在解析:,', user_input, '......') + # 定义dig命令 + dig_cmd = ['sudo apt-get install dnsutils'] + + # 执行dig命令 + result = subprocess.run(dig_cmd, capture_output=True, text=True) + + # # 输出dig命令的结果 + # print(result.stdout) + # subprocess.run(["dig", user_input]) + st.write(result.stdout) else: st.write('Please enter your name.')