前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Python_安装pycap

Python_安装pycap

作者头像
py3study
发布2020-01-13 15:58:28
7250
发布2020-01-13 15:58:28
举报
文章被收录于专栏:python3python3

pycap:http://code.google.com/p/pypcap/ sendpkt:http://code.google.com/p/sendpkt/ dpkt:http://code.google.com/p/dpkt/

我的系统是window7、python2.7,pycap和sendpkt结合起来做网络抓包分析非常好,可惜google code上提供的都是针对python2.5的,我的是python2.7,只好自己找例子去编译。 编译采用mingw编译,可以到http://www.mingw.org/上去下载,下载后安装然后添加安装路径到环境变量,看到如下效果即可:

Java代码

  1. C:\>g++ --help   
  2. Usage: g++ [options] file...   
  3. Options:   
  4.   -pass-exit-codes         Exit with highest error code from a phase   
  5.   --help                   Display this information   
  6. C:\>  
代码语言:javascript
复制
C:\>g++ --help
Usage: g++ [options] file...
Options:
  -pass-exit-codes         Exit with highest error code from a phase
  --help                   Display this information
  --target-help            Display target specific command line options
  (Use '-v --help' to display command line options of sub-processes)
  -dumpspecs               Display all of the built in spec strings
  -dumpversion             Display the version of the compiler
  -dumpmachine             Display the compiler's target processor
  -print-search-dirs       Display the directories in the compiler's search path
C:\>

现在以编译 pycap为例: 1.首先下载pycap http://pypcap.googlecode.com/files/pypcap-1.1.tar.gz 2.下载wdp http://www.winpcap.org/install/bin/WpdPack_4_0_2.zip 3.解压这两个文件到同一目录,注意:要到同一目录 4.在解压后的pycap文件夹中建立一个setup.cfg文件,内容为:

Java代码

  1. [build]   
  2. compiler=mingw32  
代码语言:javascript
复制
[build]
compiler=mingw32

5编译,如下:

Java代码

  1. C:\Users\zhaolei\Desktop\pypcap-1.1>python setup.py build   
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-08-16 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档