C:\Users\horn1\Desktop\python\35-bencode-ng>pip install py3-bencode
Collecting py3-bencode
Downloading https://files.pythonhosted.org/packages/20/07/88a2f4f3b6ca6b92dcb46b36be1f97de210ae27409ba87c97a5a615f630a/py3_bencode-0.0.2-py3-none-any.whl
Installing collected packages: py3-bencode
Successfully installed py3-bencode-0.0.2

小例程如下:

from bencode import bencode, bdecode

foo = bencode('http://www.cnblogs.com/xiandedanteng/')
print(foo)

bar = bdecode(foo)
print(bar)

输出如下:

C:\Users\horn1\Desktop\python\35-bencode-ng>python torrentParser.py
bytearray(b'37:http://www.cnblogs.com/xiandedanteng/')
bytearray(b'http://www.cnblogs.com/xiandedanteng/')

【python】安装py3-bencode 及小例程的更多相关文章

  1. Python NLTK 自然语言处理入门与例程(转)

    转 https://blog.csdn.net/hzp666/article/details/79373720     Python NLTK 自然语言处理入门与例程 在这篇文章中,我们将基于 Pyt ...

  2. 【python之路1】python安装与环境变量配置

    直接搜索 Python,进入官网,找到下载,根据个人电脑操作系统下载相应的软件.小编的是windows os .下载python-2.7.9.msi 安装包  双击安装程序,进入安装步骤.在安装过程中 ...

  3. [python] 安装numpy+scipy+matlotlib+scikit-learn及问题解决

    这篇文章主要讲述Python如何安装Numpy.Scipy.Matlotlib.Scikit-learn等库的过程及遇到的问题解决方法.最近安装这个真是一把泪啊,各种不兼容问题和报错,希望文章对你有所 ...

  4. python开发学习-day01 (python安装与版本、字符串、字典、运算符、文件)

    *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* ...

  5. 从Python小白到第一个小游戏发布

    1.安装必要的环境(附图两张) 直接下载安装程序,本人win10系统,根据电脑系统下载并安装对应的python.exe,安装路径可以选择D盘的,具体安装细节这里就不说了,不知道的可以留言或者找度娘 2 ...

  6. Python安装与使用的常见问题

    1. Python安装问题 到Python官网下载Python最新版本 Windows x86-64 executable installer (64为操作系统选择这个) Windows x86 ex ...

  7. python安装Jieba中文分词组件并测试

    python安装Jieba中文分词组件 1.下载http://pypi.python.org/pypi/jieba/ 2.解压到解压到python目录下: 3.“win+R”进入cmd:依次输入如下代 ...

  8. python 安装插件 requests、BeautifulSoup

    安装第三方插件库 1. requests  , 下载地址 https://github.com/requests/requests 安装: 利用 pip 安装 pip3 install request ...

  9. python 安装scikit!!!

    首先,吐槽一下,真的是折腾好几天,一会更新这个,一会更新那个,总是各种奇葩问题诸如此类: cannot import check-build pip有新版本,需要更新(黄字) 其中scipy出错最多, ...

随机推荐

  1. 【Go命令教程】命令汇总

    [Go命令教程]1. 标准命令详解 [Go命令教程]2. go build [Go命令教程]3. go install [Go命令教程]4. go get [Go命令教程]5. go clean [G ...

  2. Using Dtrace OEL 6.X

    http://www.hhutzler.de/blog/using-dtrace/ http://docs.oracle.com/cd/E37670_01/E38608/html/dt_sdtparg ...

  3. jQuery $('div>ul') $('div ul'

    $('div>ul')是<div>的直接后代里找<ul>: 而$('div ul')是在<div>的所有后代里找<ul>.

  4. IOS应用发布NSLog的注释及使用重定向,把控制台内容写入文件

    1 选择工程的Target -> Build Settings -> Preprocessor Macros. 如图,默认 Debug项,是“DEBUG=1”. 2 在程序中设置全局宏定义 ...

  5. DotNetty 学习

    [转载]http://www.cnblogs.com/littlegod/p/7699482.html DotNetty的学习是带着如下这些问题展开: 1. Socket基础框架方案: 通信模式:异步 ...

  6. Python:Opening Python Classes

    I won’t reply to that post much, because it’s mostly… well, not useful to respond to. But people oft ...

  7. linux配置nginx

    相关命令: nginx -s reload  :修改配置后重新加载生效 nginx -s reopen  :重新打开日志文件nginx -t -c /path/to/nginx.conf 测试ngin ...

  8. Android之用自定义的shape去实现shadow效果

    直接上xml文件, 并且附上相应的解析: <?xml version="1.0" encoding="utf-8"?> <selector x ...

  9. Android在Gallery中每次滑动只显示一页

    import android.content.Context; import android.util.AttributeSet; import android.view.KeyEvent; impo ...

  10. 详解Java多线程编程中LockSupport类的线程阻塞用法

    LockSupport类是Java6(JSR166-JUC)引入的一个类,提供了基本的线程同步原语.LockSupport实际上是调用了Unsafe类里的函数,归结到Unsafe里,只有两个函数: p ...