易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 :

[zt]Python网络工具包

Python网络工具包
coNCePTuaL coNCePTuaL is a tool designed to facilitate rapidly generating programs that measure the performance and/or test the correctness of networks and network protocol layers. coNCePTuaL centers around a simple, domain-specific programming language; a few lines of c... 官方网站: http://www.c3.lanl.gov/~pakin/software/conceptual/ 2009-06-01
Pydhcplib Pydhcplib 是一个用来读写和处理 DHCP 包的 Python 库。... 官方网站: http://pydhcplib.tuxfamily.org/ 2009-06-01
Medusa A high-performance, extensible Internet server framework.... 官方网站: http://www.nightmare.com/medusa/ 2009-06-01
dnspython dnspython 是DNS协议的一个Python开源实现。... 官方网站: http://freshmeat.net/projects/dnspython/ 2009-06-01
Beyond 2 Beyond 2是向网络虚拟世界的统一平台迈出的重要一步。作为一个开源系统,它可以加快那些虚拟世界项目的开发工作。Beyond建立在另一个开源项目—— Twisted 网络服务器[Leftkowitz02]之上并对其加以扩展,从而使任意数量的三维客户端都可以连接到一个共同的仿真框架上。B ......

python在twisted中实现二进制数据

  实现不使用原有的basic.LineReceiver作为协议基类,而改用protocol.Protocol。因为原来sendline使用了的结束符。
 
  协议定义先简单点,id + msg length + msg,
  使用pack和unpack进行封装和解析,参考http://docs.python.org/library/struct.html
  import struct
  buffer = struct.pack("5s", 'hello', )
  buffer = struct.pack("HH" , 1, len(buffer)) + buffer  // H 对应unsigned short,2个字节,16位
  print repr(buffer)
  print struct.unpack("H", buffer[:2])[0]
  print struct.unpack("H", buffer[2:4])[0]
  print repr(struct.unpack("5s", buffer[4:])[0]) ......

Python笔记(6)

 数据结构
 
一.简介
数据结构基本上就是——它们是可以处理一些数据的结构。或者说,它们是用来存储一组相关数据的。
在Python中有三种内建的数据结构——列表、元组和字典。我们将会学习如何使用它们,以及它们如何使编程变得简单。
二.列表
list是处理一组有序项目的数据结构,即你可以在一个列表中存储一个序列的项目。
一旦你创建了一个列表,你可以添加、删除或是搜索列表中的项目。由于你可以增加或删除项目,我们说列表是可变的数据类型,即这种类型是可以被改变的。在某种程度上,与数组类似。
例如:
#!/usr/bin/python
# Filename: using_list.py
# This is my shopping list
shoplist = ['apple', 'mango', 'carrot', 'banana']
print 'I have', len(shoplist),'items to purchase.'
print 'These items are:', # Notice the comma at end of the line
for item in shoplist:
print item,
print '\nI also have to buy rice.'
shoplist.append('rice')
print 'My shopping list is now', shoplist
print 'I will sort my list now'
shoplist.sort()
print 'Sorted shopping list is', shoplist
print 'T ......

我的第一个Python程序

第一个PYTHON程序
PAMIE3.0的下载地址:
http://sourceforge.net/projects/pamie/files/PAMIE/PAM3.0%20for%20Python%203.0/PAM3.0.zip/download
————————————————————————————————————————————————
#-*-coding:gb2312-*-
from cPAMIE import PAMIE
ie= PAMIE()
#打开网页
ie.navigate ('http://pamie.sourceforge.net/pamieform.html')
#填文本框
ie.textBoxSet('firstname','FirstName')
ie.textBoxSet('lastname','LastName')
#选择下拉菜单:
ie.listBoxSelect('state',"MS")
#方形选择框:
ie.checkBoxSet('cxbx',1) #1 2 3 或 * 号等都是 "勾选"的意思 '' 空字符串代表取消选择
#圆形选择框:
#这里选择 Jazz
ie.radioButtonSet("music","Jazz") # music是这个 选择列表的名字,从网页源代码里找出
ie ......

Python牛人

limodou 人称李木头,此人技术深厚,擅长写作技术blog,信仰“自己的才是大家的”!
Zoom. Quiet 人称woodpecker社区大妈,虽称大妈,不过看上去像是位艺术家,发型极具特色
http://blog.zoomquiet.org/pyblosxom/
http://www.douban.com/people/zoomq/
刘鑫 March.Liu
http://blog.csdn.net/ccat
宁柯
beyking@gmail.com
www.china-django.com
zsp(张沈鹏) ......

Python之HelloWorld!

今天在群里看到有人在讨论Python,于是GG下下,貌似蛮强大的样子。于是下班后在自己本儿上下载,郁闷的是官网居然无法打开。当然了,这个问题不大,于是乎用在线代理登录下载——!可是,代理下载不能超过2M,可能是我选的代理网站问题吧。后来就直接去搜Python下载,然后在新浪下到最新版的3.1 .1 RC。
然后就是Next的安装,完毕再加入到系统变量。
看到有教程写到经典的HelloWorld程序
print 'Hello World!' 
敲进去之后结果提示“SyntaxError: invalid synta”,纠结。网上查了下,原来3.1版本的需要改成
print('Hello World!')
呃,这样,HelloWorld完成。 ......
总记录数:40319; 总页数:6720; 每页6 条; 首页 上一页 [6276] [6277] [6278] [6279] 6280 [6281] [6282] [6283] [6284] [6285]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号