#!/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] continue if line.startswith('MemFree'): MemFree = line.split()[1] break print "总
free命令:显示系统使用和空闲的内存情况,包括物理内存.交互区内存(swap)和内核缓冲区内存. [root@ipha-dev71- workspace]# free # kb total used free shared buff/cache available Mem: Swap: [root@ipha-dev71- workspace]# free -m # MB total used free shared buff/cache available Mem: Swap: [root@i
一.基本使用 先看枚举的几种使用(暂不要问,看看是否都能看懂,待会会逐一讲解) 1.操作一 简单使用 //第一种方式 enum Direction { case east case west case south case north func testDir() -> String { switch self { case .east: return "东边" case .west: return "西边" case .south: return "