基本数据结构的python实现 队列
队列:
与堆栈类似,通过python的列表类型来实现,参考 help(list)
shoplist=['apple','mango','carrot','banana']
print 'I have',len(shoplist),'items to purchase'
print 'these items are:'
for item in shoplist:
print item,
shoplist.append('rice')
print 'my shopping list is now', shoplist
shoplist.sort()
print 'Sorted shopping list is',shoplist
olditem=shoplist[0]
del shoplist[0]
print 'I bought the',olditem
print 'My shopping list is now',shoplist
相关文档:
#filename Seek.py
import unicodedata
import sys
import os
class Seek():
"""
功能:查找中文,并替换成指定字符或字符串
使用方法:python脚本用法
参数说明:
-d& ......
对于个人版,使用了.NET,安装完企业版后,看了看目录,发现大量python脚本。dll中也有sqlite3.dll
C:\Program Files\China Mobile\Efetion目录下文件:
Addin
boost_python.dll
bz2.pyd
dbghelp.dll
EFetion.exe
EFetion.exe.manifest
EFWP.exe
EFXLiveUpdate.exe
EFXLiveUpdate.exe.manifest
Face
Help.chm
......
假设你你的操作系统是WinXP:
开始菜单-> 运行-> cmd
然后就可以敲命令了。
如果你用IDLE,可以用IDLE打开这个.py文件,然后在菜单 "Run "下有一项 "Run Module ",点击即可。 ......
1,编写Server.py
import socket
s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
s.bind(('localhost',8081))
while True:
data,addr=s.recvfrom(1024)
print 'receive:',data,'from',addr
2,编写Client.py
import socket
s=socket.socket(socket.AF_INET,socket.SOC ......
编译了一个windows下的python3连接Mysql的库
mypysql
版本是 0.5.1 ,根据官方的修改日志,这个版本修改了0.5中一个内存泄漏问题。
源代码和编译后的文件为:
http://211.147.215.55/down/mypysql-0.5.1-win.zip
mypysql的官方地址 https://sourceforge.net/projects/mypysql/
......