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

python 1073

#Python
wxpython GUI界面显示jpg图片

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

2015-06-16 567

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

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

2015-06-16 1,014

#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 797

#Python
通过python自动连接ssh服务器

#!/usr/bin/python #-*- coding:utf-8 -*- import sys, time, os try: import pexpect except Im…

2015-06-16 748

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

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

2015-06-15 993

#Python
下载壁纸

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

2015-06-15 712

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

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

2015-06-15 758

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

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

2015-06-15 272

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

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

2015-06-15 441

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

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

2015-06-15 550

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

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

2015-06-15 866

#Python
用Python实现二分查找

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

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