#-*-coding:utf-8-*-#python:2.x__author__='Administrator'#TK实现一个秒表效果#目的:是为了简单学习下TKfromtimeimport*fromTkinterimport*classStopWatch(Frame):mesc=50def__in...
分类:
编程语言 时间:
2014-09-09 11:48:48
阅读次数:
551
python3.4环境,在3.0以下的版本有些地方不一样,可自行修改。可转换全部文章,唯一缺陷就是标点符号正常无法转换。以后想到再做修改。 1 #coding=gbk 2 ''' 3 Created on 2014-8-29 4 5 @author: Administrator 6 ''' 7 #....
分类:
编程语言 时间:
2014-09-09 10:35:48
阅读次数:
466
先是逐步插值,主体十分简单,关键在于算法部分,我运用了矩阵的数据结构来存储每次迭代后的新值。角标的循环初看可能有些复杂,自己动手走一遍就会很清楚啦 1 #coding=gbk 2 ''' 3 Created on 2014-8-31 4 5 @author: Administrator 6 '''....
分类:
编程语言 时间:
2014-09-08 10:43:16
阅读次数:
773
这两天温故了python的multiprocessing多进程模块,看到的pipe和queue这两种ipc方式,啥事ipc?ipc就是进程间的通信模式,常用的一半是socke,rpc,pipe和消息队列等。今个就再把pipe和queue搞搞。#coding:utf-8
importmultiprocessing
importtime
defproc1(pipe):
whileTrue:
..
分类:
编程语言 时间:
2014-09-08 03:16:16
阅读次数:
421
本篇将讨论gevent的两架马车-libev和greenlet如何协同工作的。gevent事件驱动底层使用了libev,我们先看看如何单独使用gevent中的事件循环。#coding=utf8
import socket
import gevent
from gevent.core import loop
def f():
s, address = sock.accept()
p...
分类:
其他好文 时间:
2014-09-08 01:04:46
阅读次数:
396
erminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant ...
分类:
其他好文 时间:
2014-09-07 03:17:24
阅读次数:
147
#-*-coding:utf-8-*-#python:2.x__author__='Administrator'fromftplibimportFTP#加载#方法或者属性#ftp=FTP()#变量#ftp.set_debuglevel(2)#调试级别为2,显示详细信息#ftp.connect('IP...
分类:
编程语言 时间:
2014-09-06 12:24:43
阅读次数:
321
#-*-coding:utf-8-*-#python:2.x__author__='Administrator'fromnntplibimport*#nnt.group('name')#选择一个组的名字,返回一个元组(rsp,ct,fst,lst,group):服务器返回信息文件数量,第一个和最后一...
分类:
编程语言 时间:
2014-09-06 12:22:33
阅读次数:
1008
#-*-coding:utf-8-*-#python:2.x__author__='Administrator'importasynchat,asyncore,logging,socket#asyncore异步IO#作用:异常IO处理#功能是处理IO对象,如套接字,从而能异步管理这些对象(而不是多个...
分类:
编程语言 时间:
2014-09-05 19:52:11
阅读次数:
305
#-*-coding:utf-8-*-#python:2.x__author__='Administrator'importselect,socket,sys,Queue#作用:等待输入或者输出通道已经准备就绪的通知#select模块允许访问特定平台的IO监视函数,可移植接口是POSIX函数sele...
分类:
编程语言 时间:
2014-09-05 19:39:41
阅读次数:
323