![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
cslie
这个作者很懒,什么都没留下…
展开
-
scapy windows install
最近有点扫描网络的需求,都说scapy好,但是安装是个事(当然指的是windows安装)有个scapy3k,支持python3,可惜需要powershell,也就是说windows xp是没有戏了。网上说最好python2.6,但这年头,谁还能忍python2.6啊,连centos都已经是python2.7了,scapy有几个重要的依赖,WinPcap,这个好办,官方下载一个,转载 2017-05-23 17:23:52 · 557 阅读 · 0 评论 -
Condition 缩小版
Condition 源代码精简版,代码写的乱,大概是这个意思,用2个锁实现交替运行,from threading import Lock,Threadclass MyCondition: def __init__(self): self.lock = Lock() self.waiter = Lock() def __enter__(sel...原创 2018-07-31 15:47:59 · 308 阅读 · 0 评论 -
dfs 写一遍
int a[10],book[10],total=0;void dfs(int step){if(step==10){if(a[1]*100+a[2]*10+a[3]+a[4]*100+a[5]*10+a[6] == a[7]*100+a[8]*10+a[9]){printf("%d%d%d + %d%d%d = %d%d%d\n",a[1],a[2],a[原创 2017-06-13 20:22:30 · 323 阅读 · 0 评论 -
python 检测[](){}匹配小程序
s = input("输入检测字符串")pp = Truestack = []for x in s: print(stack) if x==')': y=stack.pop() if y!='(': pp = False print('不匹配') break elif x==原创 2017-06-13 13:01:11 · 1054 阅读 · 0 评论 -
迷茫
转一篇大V的英雄事迹从 Python 博主到知乎大V:资深 Python 工程师的12年进阶路https://cn.100offer.com/blog/posts/243?utm_source=tuicool&utm_medium=referral最近,100offer 在知乎上受用户邀请回答问题「爬虫工程师的未来方向在哪?」。从这个问题中,原创 2017-06-11 19:08:13 · 461 阅读 · 0 评论 -
文本输出的变量插入
参考手册 9.7一、 第一种形式x = '''\你好 %(name) 欢迎!'''print( x % {'name':'花无缺'})出错 print( x % {'name':'花无缺'})ValueError: unsupported format character '?' (0x6b22) at index 11知道哪里原创 2017-06-10 22:13:28 · 368 阅读 · 0 评论 -
只执行一次的装饰器
最近在看 参考手册,写的真心好,不过有些地方不够详细 p83 event_handler={}def eventhandler(event): def register(f): print(event) event_handler[event] = f return f return register@event原创 2017-06-09 17:32:31 · 701 阅读 · 0 评论 -
多个装饰器的执行顺序
def first(func): def inner(): print("this is firt!") func() return innerdef second(func): def inner(): print("this is second!") func() return innerd原创 2017-06-09 16:29:36 · 1728 阅读 · 1 评论 -
Pycharm 快捷键盘
pycharm 如何设置快速跳出括号def doctest(这里跳出)ctrl+}原创 2017-06-08 18:02:32 · 2428 阅读 · 1 评论 -
IP报头检验和算法的python实现
进击的麦兜兜的博客http://blog.sina.com.cn/xiaopeng163 IP校验和字段是用来检验数据传输正确性的。在发送数据时,为了计算IP数据报的校验和,按如下步骤:(1) 把IP数据报的校验和字段置为0;(2) 把首部看成以16位为单位的数字组成,依次进行二进制反码求和;(3)转载 2017-06-05 22:45:33 · 2322 阅读 · 3 评论 -
Scapy 文摘
网上找的,先谢谢作者吧Scapy小记 http://blog.sina.com.cn/s/blog_4b5039210100f43h.html原创 2017-05-25 14:41:28 · 276 阅读 · 0 评论 -
win7 安装 scapy 有效lib ,亲测
https://github.com/Kondziowy/scapy_win64 有win32 和 win64 的原创 2017-05-24 09:34:04 · 918 阅读 · 0 评论 -
个人推荐的Python 书籍
初学python ,哈哈,都可以推荐了第一本入门: 编程小白的第一本 python 入门书 写的很好,有编程基础一会就看完了第二本: 随便啦 1、python参考手册 辅助类,过一边吧,到时候查查 2、流畅的python 仔细看吧 。第三本: 想学原创 2017-05-24 09:40:28 · 4873 阅读 · 0 评论 -
Semaphore 源代码精简
把源代码抄了一遍,姑且认为学习吧import timefrom threading import Condition,Threadclass MySemaphore: def __init__(self,value=1): self._value = value self._condition = Condition() def ac...原创 2018-07-31 17:26:17 · 353 阅读 · 0 评论