摘要: socket是一种双向通信的起点和重点,氛围服务器端和客户端Socket服务器端用到的方法有MethodDescriptions.bind()This method binds address (hostname, port number pair) to socket.s.listen()This... 阅读全文
posted @ 2014-11-01 23:41 shall we 阅读(375) 评论(0) 推荐(0) 编辑
摘要: 采用tkinter实现了几个简单的GUI界面调用tkinter的方式非常简单,只需要如下几行代码1 import Tkinter2 top = Tkinter.Tk()3 # Code to add widgets will go here...4 top.mainloop()使用Button ... 阅读全文
posted @ 2014-11-01 23:07 shall we 阅读(1086) 评论(0) 推荐(0) 编辑
摘要: 如何用python创建线程 python中提供了两种创建线程的方式 1.采用thread.start_new_thread(funciton,args..) 2.继承threading.Thread类 1.采用thread.start_new_thread(function,agrs..)方式 该方法的使用方式在官方手册中介绍的非常清楚 thread.start_new_t... 阅读全文
posted @ 2014-11-01 22:59 shall we 阅读(438) 评论(0) 推荐(0) 编辑
摘要: 作为一种简洁的脚本语言,对文件操作的支持非常好,只需要几个语句就能够完成文件操作Python还提供了持久化库pickle,可以内存中的对象持久化到文件中。虽然有大量对象进行持久化并需要还原的时候会有所欠缺,一般情况下算是提供了一个非常强大的数据源,不需要指定配置数据库,即可持久化所需要的对象。就像有... 阅读全文
posted @ 2014-11-01 22:55 shall we 阅读(169) 评论(0) 推荐(0) 编辑
摘要: python提供了两种解析xml的方式SAX Simple API for xml适合解析大型文件,因为解析内容不会保存在内容中,而是在解析到相关内容的时候调用注册的方法DOM document object model将整个文档读取到内存中形成一个树形结构sax解析方式 import xml... 阅读全文
posted @ 2014-11-01 22:49 shall we 阅读(246) 评论(0) 推荐(0) 编辑