diff --git a/PyPI/setup.cfg b/PyPI/setup.cfg index e324de0..107a849 100644 --- a/PyPI/setup.cfg +++ b/PyPI/setup.cfg @@ -1,7 +1,7 @@ [metadata] # replace with your username: name = guan -version = 0.1.44 +version = 0.1.45 author = guanjihuan author_email = guanjihuan@163.com description = An open source python package diff --git a/PyPI/src/guan.egg-info/PKG-INFO b/PyPI/src/guan.egg-info/PKG-INFO index 21f7ca1..fc015a4 100644 --- a/PyPI/src/guan.egg-info/PKG-INFO +++ b/PyPI/src/guan.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: guan -Version: 0.1.44 +Version: 0.1.45 Summary: An open source python package Home-page: https://py.guanjihuan.com Author: guanjihuan diff --git a/PyPI/src/guan/others.py b/PyPI/src/guan/others.py index f9684a0..6ed11c8 100644 --- a/PyPI/src/guan/others.py +++ b/PyPI/src/guan/others.py @@ -44,6 +44,16 @@ def get_cpu_usage(interval=1): guan.statistics_of_guan_package() return cpu_usage +# 获取内存信息 +def get_memory_info(): + import psutil + memory_info = psutil.virtual_memory() + total_memory = memory_info.total + used_memory = memory_info.used + available_memory = memory_info.available + used_memory_percent = memory_info.percent + return total_memory, used_memory, available_memory, used_memory_percent + # 获取本月的所有日期 def get_days_of_the_current_month(str_or_datetime='str'): import datetime