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

python 1073

#Python
python代码实例大小写转换,首字母大写,去除特殊字符

总结我们在平常开发过程中对字符串的一些操作: #字母大小写转换 #首字母转大写 #去除字符串中特殊字符(如:’_’,’.’,R…

2015-01-11 793

#Python
python操作mysql数据库代码

python操作mysql数据库的相关操作实例 # -*- coding: utf-8 -*- #python operate mysql database import MySQ…

2015-01-11 448

#Python
python使用Queue实现优先级队列

使用Queue.Queue实现的线程安全的优先级队列: import Queue class PriorityQueue(Queue.Queue): def _put(self, …

2015-01-11 981

#Python
Python实现的哈夫曼编码

#coding:utf-8 import struct codeDict={}#全局字典key=字符,value=数字 encodeDict={} filename=None li…

2015-01-11 738

#Python
Python抓妹子图+多进程

# -*- coding: utf-8 -*- """ Created on Fri Aug 07 17:30:58 2015 @author: Dreace """ import…

2015-01-11 522

#Python
多线程下载豆瓣相册

#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2014-12-22 14:46:40 # @Author : ku…

2015-01-10 151

#Python
Python实现HTTP代理服务器

这些天闲来无事就研究了下HTTP代理原理,顺便用Python做了个很挫的程序。 先来说说代理,所谓代理其实跟带话差不多。比方说A要跟C通信,但A和C之间没有通信渠道,这个时候就需要…

2015-01-10 778

#Python
Python 验证码识别

Python识别验证码 #encoding=utf-8 import Image,ImageEnhance,ImageFilter import sys image_name = …

2015-01-10 706

#Python
python 调用windows api查看系统的电量

通过调用GetSystemPowerStatus Windows Api来判断AC Power是开启还是关闭状态。是一个python调用windows api的例子。 import…

2015-01-09 1,029

#Python
pygame simulate

import pygame,sys,random,time from pygame.locals import* FPS = 30 green =(0,255,0) darkgre…

2015-01-09 777

#Python
取一列数中连续最长的奇数个数

n=0 b=[] a=[2,3,3,0,0,2,4,7,5,7] for i in a: if i%2!=0: n+=1 b.append(n) else: n=0 print m…

2015-01-08 789

#Python
Python实现 深度优先算法生成迷宫

import random #warning: x and y confusing sx = 10 sy = 10 dfs = [[0 for col in range(sx)] …

2015-01-08 944
1 74 75 76 77 78 90