python---强大的twisted 网络编程框架(简单应用)

强大的twisted 网络编程框架 服务器端 from twisted.internet import reactor from twisted.internet.protocol import Protocol, Factory class SimpleLogger(Protocol):   def connectionM...

2012/04/04 22:56
552
python--小型通信

客户机 import socket s = socket.socket() host = socket.gethostname() port = 1234 s.connect((host,port)) print s.recv(1024) 服务器 from SocketServer import TCPServer,StreamReque...

2012/04/04 12:31
57
python--简单的编译器

简单的编译器 import wx def load (event):   file = open(filename.GetValue())   contents.SetValue(file.read())   file.close() def save (event):   file = open(filename.GetValue(),'w')...

2012/03/31 23:17
371
python---代码演示

def init(data):   data['first'] = {}   data['middle'] = {}   data['last'] = {} def lookup(data,label,name):   return data[label].get(name) def store(data,full_name):   names = full_...

2012/03/13 08:59
21.4W
python---使用get方法访问‘数据库’实体

使用get方法访问‘数据库’实体 #simple database #people people = {   'Alice':{     'phone':'2341',     'addr':'Foo drive 23'   },   'Beth':{     'phone':'9102',     'addr':'Bar street 42'...

2012/03/11 15:42
21.4W
python---简单的html模板生成代码

简单的html模板生成代码 #template auto genetate template = ''' <html>   <head>     <title>%(title)s</title>   </head>   <body>     <h1>%(title)s</h1>     <p>%(text)s</p>   </body> </html>'...

2012/03/11 12:36
21.7W
python---简单数据库

#simple database #people people = {   'Alice':{     'phone':'2341',     'addr':'Foo drive 23'   },   'Beth':{     'phone':'9102',     'addr':'Bar street 42'   },   'Ceil':{     'phone':'3158'...

2012/03/11 12:23
21.4W
pyhton---简单的价格和目录格式输出

width = input('Please enter width: ') price_width = 10 item_width = width - price_width header_format = '%-*s%*s' format = '%-*s%*.2f' print '=' * width print header_format % ...

2012/03/11 10:50
21.4W
python实现csv转换为html

import sys def main(): maxwidth = 100 print_start() count = 0 while True: try: line = input() if count == 0: col...

2011/12/31 14:35
2.5K

没有更多内容

加载失败,请刷新页面