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

python 1073

#Python
python显示生日是星期几

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

2015-06-16 570

#Python
wxpython GUI界面显示jpg图片

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

2015-06-16 546

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

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

2015-06-16 995

#Python
用python做的另外一种实现的二分查找

arr = [1,2,3,4,5,6,7,8,9,10]; def search(someone, arr): l = -1; h = len(arr); while l + 1 …

2015-06-16 776

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

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

2015-06-15 254

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

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

2015-06-15 421

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

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

2015-06-15 531

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

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

2015-06-15 848

#Python
用Python实现二分查找

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

2015-06-15 903

#Python
python(PIL)图像处理(等比例压缩、裁剪压缩) 缩略(水印)图

#coding:utf-8 ''' python图片处理 @author:fc_lamp @blog:http://fc-lamp.blog.163.com/ ''' import…

2015-06-15 886

#Python
python编写的用于测试网站访问速率的代码片段

python编写的用于测试网站访问速率的代码片段,可以输出打开某url的时间,访问100次的平均时间,最大时间和最小时间等等 def Process(url,n): minSpan…

2015-06-15 303

#Python
python提取url中的域名和端口号

python提取url中的域名和端口号 import urllib proto, rest = urllib.splittype("http://www.open-ope…

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