读取树梅派内存使用情况
来源:互联网 发布:网上购物商城源码 编辑:程序博客网 时间:2024/06/18 05:10
方法一:
free -m
方法二:
建立一个文件 RAM.py 运行.
#!usr/bin/python#-*- coding: UTF-8 -*-import osimport timeimport re while True: # Get memory usage info cpuinfo = os.popen("free -m | grep Mem") strMem = cpuinfo.readline() # Get all the number from string numMem = re.findall("\d+", strMem) print("Total memory: %sMB, Used memory: %sMB, Memory usage:%d%%" \ %(numMem[0], numMem[1], int(numMem[1])*100/int(numMem[0]))) time.sleep(3)
运行结果:
参考:http://www.eefocus.com/nightseas/blog/15-05/312904_949ea.html
阅读全文
0 0
- 读取树梅派内存使用情况
- 简单读取TOMCAT的内存使用情况
- Android 读取SD卡中文件以及内存使用情况
- linux内存使用情况
- 查看内存使用情况
- 列出内存使用情况
- 内存使用情况
- oracle 内存使用情况
- 内存使用情况
- Linux 内存使用情况
- 内存使用情况
- jvm内存使用情况
- python内存使用情况
- 内存使用情况查看
- 查看内存使用情况
- CRF的内存使用情况
- Linux内存使用情况详解
- 查看TOMCAT内存使用情况
- hadoop 配置文件
- ORA-10485: Real-Time Query cannot be enabled while applying migration redo
- poj3006 素数
- 百练+递归模拟题+二进制思想 理解好递归每一层做什么
- 俄罗斯信封问题
- 读取树梅派内存使用情况
- 线段树总结
- 用Python编写的基于Windows的优化程序
- 例题6-14 Abbott的复仇(Abbott's Revenge, ACM/ICPC World Finals 2000, UVa 816)
- sublime如何安装pylinter
- unity制作游戏中掉血飘红滚动数值的制作
- Ubuntu16.04安装anaconda3+tensorflow
- MongoDB之基本命令
- mysql update,insert常用