[add]获取系统信息

This commit is contained in:
judy 2021-08-23 12:26:22 +08:00
parent 1e4f87f2e2
commit 529074cee7

23
system_info.py Normal file
View File

@ -0,0 +1,23 @@
import platform
import miuitask
from urllib.request import getproxies
def show_info(tip, info):
return "{}: {}".format(tip, info)
def system_info():
miuitask.wLog(show_info("系统及版本信息", platform.platform()))
miuitask.wLog(show_info('系统版本号', platform.version()))
miuitask.wLog(show_info('系统名称', platform.system()))
miuitask.wLog(show_info('系统位数', platform.architecture()))
miuitask.wLog(show_info('计算机类型', platform.machine()))
miuitask.wLog(show_info('处理器类型', platform.processor()))
miuitask.wLog(show_info('Python版本', str(platform.python_version()) + ' ' + str(platform.python_build())))
if getproxies():
miuitask.wLog(show_info('系统代理', getproxies()))
if __name__ == '__main__':
system_info()