# -*- coding: utf-8 -*- """ Created on Fri Aug 07 17:30:58 2015 @author: Dreace """ import…
线程池的概念是什么? 在面向对象编程中,创建和销毁对象是很费时间的,因为创建一个对象要获取内存资源或者其它更多资源。在Java 中更是 如此,虚拟机将试图跟踪每一个对象,以便能够在…
总结我们在平常开发过程中对字符串的一些操作: #字母大小写转换 #首字母转大写 #去除字符串中特殊字符(如:’_’,’.’,R…
python操作mysql数据库的相关操作实例 # -*- coding: utf-8 -*- #python operate mysql database import MySQ…
使用Queue.Queue实现的线程安全的优先级队列: import Queue class PriorityQueue(Queue.Queue): def _put(self, …
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2014-12-22 14:46:40 # @Author : ku…
这些天闲来无事就研究了下HTTP代理原理,顺便用Python做了个很挫的程序。 先来说说代理,所谓代理其实跟带话差不多。比方说A要跟C通信,但A和C之间没有通信渠道,这个时候就需要…
Python识别验证码 #encoding=utf-8 import Image,ImageEnhance,ImageFilter import sys image_name = …
import pygame,sys,random,time from pygame.locals import* FPS = 30 green =(0,255,0) darkgre…
通过调用GetSystemPowerStatus Windows Api来判断AC Power是开启还是关闭状态。是一个python调用windows api的例子。 import…
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…
import random #warning: x and y confusing sx = 10 sy = 10 dfs = [[0 for col in range(sx)] …