This commit is contained in:
shenjack 2024-06-29 01:03:44 +08:00
parent 0ee8091e0d
commit 2f00a3f29a
Signed by: shenjack
GPG Key ID: 7B1134A979775551

View File

@ -25,8 +25,11 @@ def local_env_info() -> str:
# Python 版本信息 # Python 版本信息
cache.write(f"{platform.python_implementation()}: {platform.python_version()}-{platform.python_branch()}({platform.python_compiler()})\n") cache.write(f"{platform.python_implementation()}: {platform.python_version()}-{platform.python_branch()}({platform.python_compiler()})\n")
# 内存信息 # 内存信息
try:
memory = psutil.virtual_memory() memory = psutil.virtual_memory()
cache.write(f"内存: {memory.free / 1024 / 1024 / 1024:.3f}GB/{memory.total / 1024 / 1024 / 1024:.3f}GB\n") cache.write(f"内存: {memory.free / 1024 / 1024 / 1024:.3f}GB/{memory.total / 1024 / 1024 / 1024:.3f}GB\n")
except OSError:
cache.write("内存: 未知\n")
return cache.getvalue() return cache.getvalue()
def local_env_image() -> bytes: def local_env_image() -> bytes: