Python Firewall Win32 (pyfw
Python Firewall Win32 (pyfw-win32)
pyfw-win32是一个可用Python脚本开发数据包过滤(防火墙)的模块。底层使用C语言编写的NDIS中间层驱动(NDIS IMD)提供支持,上层提供Python开发接口。可用Python脚本处理所有逻辑问题,而不必关心底层实现,达到快速、灵活开发的目的。
Google 项目托管:
http://code.google.com/p/pyfw-win32/
作者:dahubaobao
MSN: dahu_baobao@hotmail.com
相关文档:
源代码下载:下载地址在这里
# 032
# 其实cPickle这个模块起到的作用可以用“完美地协调了文件中的内容(对象)和代码中的引用”来形容
import cPickle as p # 这条语句给cPickle起了个小名p
objectFileName = r'C:\Data.txt'
aList = [1, 2, 3]
f = file(objectFileName, 'w')
p.dump(aList, f)
f.close ......
源代码下载:下载地址在这里
# 034
class Person:
def __init__(self, name):
self.name = name # 这一句中第一个name是类中包含的域,第二个name是传进来的参数
# end of def
def sayHello(self):
print 'Hello!'
# end of def
# end of class
p = Person('Ning')
print p.nam ......
源代码下载:下载地址在这里
# 035
class Person:
population = 0 #这个变量是属于整个类的
def __init__(self, name):
self.name = name
print '初始化 %s' % self.name
Person.population += 1
# end of def
def __del__(self):
print '%s says bye.' % self. ......
python string和PyQt的QString的区别 以下在Python2.6和PyQt4.4.4 for
Python2,6环境下讨论: Python中有两种有关字符的类型:Python string object和Python Unicode
object。主要使用Python string object进行数据输入输出。 PyQt中与之相对应的字符有关类
python string和PyQt的QString的区别
以下在Python2.6和PyQt4 ......
说实话,Python真的不太适合做这种二进制的东西,天生没有指针,导致在C/C++很容易的东西在Python下就很麻烦。不过好像3.1有了原生的bytes类型,不知道能不能改变现状。
import sys
import time
import socket
import struct
import random
def SendPacketData (Buffer = None , DestIP = "127.0.0.1" , DestPort = 0 ......