摘要:
#!/usr/bin/env python #-*- coding:utf-8 -*- ''' 递归打印指定目录下的所有文件 ''' import os def list_all_files(path): for i in os.listdir(path): files = os.path.join(path, i) if os.path.isfil... 阅读全文
摘要:
#!/usr/bin/env python #-*- coding:utf-8 -*- ''' 统计内存信息 ''' with open('/proc/meminfo') as fd: for line in fd: if line.startswith('MemTotal'): MemTotal = line.split()[1] ... 阅读全文