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

python 1073

#Python
Python抓妹子图+多进程

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

2015-01-11 505

#Python
python线程池进一步认识

线程池的概念是什么? 在面向对象编程中,创建和销毁对象是很费时间的,因为创建一个对象要获取内存资源或者其它更多资源。在Java 中更是 如此,虚拟机将试图跟踪每一个对象,以便能够在…

2015-01-11 367

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

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

2015-01-11 774

#Python
python操作mysql数据库代码

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

2015-01-11 431

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

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

2015-01-11 962

#Python
多线程下载豆瓣相册

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

2015-01-10 128

#Python
Python实现HTTP代理服务器

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

2015-01-10 750

#Python
Python 验证码识别

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

2015-01-10 675

#Python
pygame simulate

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

2015-01-09 758

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

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

2015-01-09 1,004

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

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

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

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