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

python 1073

#Python
python zip和unzip数据

# zipping and unzipping a string using the zlib module # a very large string could be zipp…

2015-06-16 521

#Python
python显示生日是星期几

# find the day of the week of a given date # Python will trap impossible dates like (1900,…

2015-06-16 571

#Python
wxpython GUI界面显示jpg图片

# show a jpeg (.jpg) image using wxPython, newer coding style # two different ways to load…

2015-06-16 547

#Python
python十进制转二进制,可指定位数

python十进制转二进制,可指定位数 # convert a decimal (denary, base 10) integer to a binary string (base…

2015-06-16 996

#Python
使用递归方法分解Python中多重嵌套列表

#Welcome to My blog #www.suzhengpeng.com def listPrint(listName): for fstItem in listName:…

2015-06-15 975

#Python
下载壁纸

import re import os import urllib.request home = "http://www.gamersky.com/ent/wp/" i_coun…

2015-06-15 688

#Python
python统计文本字符串里面单词出现的频率

python统计文本字符串里面单词出现的频率 # word frequency in a text # tested with Python24 vegaseat 25aug200…

2015-06-15 740

#Python
python删除源文件中的注释并编译

上线需要,将py的源码中注释删掉,然后编译成字节码。写此脚本主要是为了删除注释。当然如果上线不想放py源码,则在最后增加删除源码即可。 #!/bin/env python # -*…

2015-06-15 255

#Python
python提取页面内的url列表

python提取页面内的url列表 from bs4 import BeautifulSoup import time,re,urllib2 t=time.time() websi…

2015-06-15 422

#Python
Windows下Python获取磁盘空闲空间并写入日志

from ctypes import * import time import win32file run = True logfile = open('.\\log.out','…

2015-06-15 532

#Python
python正则表达式提取网页URL

python正则表达式提取网页URL import re import urllib url="http://www.open-open.com" s=urll…

2015-06-15 849

#Python
用Python实现二分查找

#!/usr/bin/env python import sys def search2(a,m): low = 0 high = len(a) - 1 while(low <…

2015-06-15 904
1 41 42 43 44 45 90