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

python 1073

#Python
快速激活码生成V2

# coding=utf-8 # config 为配置词典 # y 是长度 最终生产出来的验证码是 长度 = Y - title的长度 # x 是循环次数 生成数量 # title…

2015-01-04 580

#Python
Python的时间转换

要进行时间转换,在python里面是非常简单的,这里会使用到 time 模块里的 strptime() 和 strftime()。 下面我们用实例来演示一下: strptime()…

2015-01-04 784

#Python
Python实现登录人人网并抓取新鲜事的方法

from sgmllib import SGMLParser import sys,urllib2,urllib,cookielib class spider(SGMLParser…

2015-01-03 704

#Python
git 提交到 gerrit

#!/usr/bin/env python #coding:utf-8 ''' ''' import os import sys originName = "origin" ver…

2015-01-02 634

#Python
求a到b之间所有质数

def Prime(b): i = 2 while i < b: if 0 == (j%i): return False else: i = i + 1 return Tru…

2015-01-01 328

#Python
Python去除list中的重复元素的最简单办法

初学者经常会遇到如何移除list中重复元素的问题。 这个问题在其他语言中可能需要for循环什么的,而在python中不用这样,非常简单,只需要将list作为set的构造函数构造一个…

2015-01-01 870

#Python
Python汉字转拼音

使用字典和转换程序,将汉字转换为拼音,配置好之后,可以转换为汉字拼音首字符和汉字全拼.这个使用一个字典和转化程序就行.网上有一个署名为caocao的人做了一个python的汉字转拼…

2015-01-01 966

#Python
pygame tetromino 俄罗斯方块

import pygame,sys,time,random from pygame.locals import* FPS = 25 winx = 640 winy = 480 bo…

2014-12-31 895

#Python
pil 放缩图像功能

import Image import os if __name__ == "__main__": infile = raw_input('give me a file with …

2014-12-31 352

#Python
Python将byte数组转换为int

代码 import struct import ctypes def test_struct(buf, offset): return struct.unpack_from(&qu…

2014-12-31 794

#Python
Python测试Sqlite代码

from sqlite3 import * import os, time, datetime, platform path = "./testP.sqlite"…

2014-12-30 141
1 77 78 79 80 81 90