This commit is contained in:
guanjihuan 2023-11-26 19:47:56 +08:00
parent 38103d52e9
commit e332155cdd
3 changed files with 12 additions and 2 deletions

View File

@ -1,7 +1,7 @@
[metadata] [metadata]
# replace with your username: # replace with your username:
name = guan name = guan
version = 0.1.44 version = 0.1.45
author = guanjihuan author = guanjihuan
author_email = guanjihuan@163.com author_email = guanjihuan@163.com
description = An open source python package description = An open source python package

View File

@ -1,6 +1,6 @@
Metadata-Version: 2.1 Metadata-Version: 2.1
Name: guan Name: guan
Version: 0.1.44 Version: 0.1.45
Summary: An open source python package Summary: An open source python package
Home-page: https://py.guanjihuan.com Home-page: https://py.guanjihuan.com
Author: guanjihuan Author: guanjihuan

View File

@ -44,6 +44,16 @@ def get_cpu_usage(interval=1):
guan.statistics_of_guan_package() guan.statistics_of_guan_package()
return cpu_usage 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'): def get_days_of_the_current_month(str_or_datetime='str'):
import datetime import datetime