首页 软件开发 代码片段 python ( Page 25 )

python 1073

#Python
python获得linux服务器的内存使用率,虚拟内存使用率

python获得linux服务器的内存使用率,虚拟内存使用率. linux系统的内存占用信息在/proc/meminfo文件中。 您可以打开这个文件会看到更多详细的信息。 def …

2015-09-05 127

#Python
Python计算-对列表元素分类统计

list = ['a', 'b', 'c', 'a', 'c', 'a'] res = {} for each in list: res[each] = res.get(each,…

2015-09-05 686

#Python
python http上传文件处理示例

<HTML> <FORM ACTION='cgi-bin/action.py' METHOD='POST' enctype='multipart/form-dat…

2015-09-05 344

#Python
python 实现微信模板消息发送

#WechatPush.py # encoding: utf-8 import urllib2,json class WechatPush(object): def __init_…

2015-09-05 178

#Python
获得进程内存使用量的Python脚本

#!/usr/bin/env python # Try to determine how much RAM is currently being used per program.…

2015-09-05 816

#Python
python操作符重写,实现+操作符

import string class spam: def __init__(self): self.eggs = 1 def __del__(self): pass def __…

2015-09-05 354

#Python
python中的虚函数

class Super: def method(self): print 'in Super.method' def delegate(self): self.action() c…

2015-09-05 485

#Python
抓取知乎日报内容在本地另存为txt文档

#Filename:getZhihu.py import re,os import urllib2 from bs4 import BeautifulSoup import sys…

2015-09-04 920

#Python
解决把两个数字的和、积分别告诉两个人猜两个数字组合的问题

# -*- coding: utf-8 -*- # 原题:一个老师从2到9中取两个数字,给甲说了和,给乙说了积, # 甲说我不知道,乙说我也不知道,甲说你不知道那我就知道了, # …

2015-09-03 199

#Python
最美应用爬虫

import requests import re url = "http://zuimeia.com" r = requests.get('http://zuimeia.com/…

2015-09-03 340

#Python
python和bash统计CPU利用率

#!/usr/bin/python # -*- coding:utf8 -*- __author__ = 'chenwx' def cpu_rate(): import time …

2015-09-02 940

#Python
批量修改图片大小Python代码

# -*- coding: utf-8 -*- ''' ''' import os from PIL import Image pic_dir = r"H:\新建文件夹&…

2015-09-02 1,005
1 23 24 25 26 27 90