# This is a sample Python script.
import psutil
def get_mem_info():
mem = psutil.virtual_memory()
mem1 = str(mem.total / 1024 / 1024 / 1024)
mem2 = str(mem.free / 1024 / 1024 / 1024)
print("内存总数为:", mem1[0:3], "G")
print("空闲内存总数:", mem2[0:3], "G")
# Press Ctrl+F8 to toggle the breakpoint.
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
get_mem_info()
# get_one_video("D:/11111.mp4")
# get_mem_info()
# print_hi('PyCharm')
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
python读取内存和空闲内存
原创
©著作权归作者所有:来自51CTO博客作者东方佑的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章