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. Unity3D脚本(MonoBehaviour)生命周期

    场景中有2个物体:A,B 每一个物体上绑定2个脚本:A,B 初始化log: Object : A , Script : B , Message : Awake Object : A , Script ...

  2. GetBuiltProjectOutputRecursive error running Xamarin Forms iOS on Visual Studio

    Seems like I get this weird problem while running Xamarin.iOS on Visual studio. This happened after ...

  3. tms web core pwa让你的WEB APP离线可用

    tms web core pwa让你的WEB APP离线可用 tms web core允许创建渐进式Web应用程序(PWA).渐进式Web应用程序是为适应在线/离线情况,各种设备类型,最重要的是,让自 ...

  4. linux服务器使用iftop查看带宽流量IP

    20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送) 国内私募机构九鼎控股打造,九鼎投资是在全国股 ...

  5. DataGridView 在 WinForms中应用不同的单元格式

    /// <summary> /// Set the cell background colour to make the ups and downs more visible. /// & ...

  6. GO -- 正则表达式

    str := "880218end" match, _ := regexp.MatchString("\\d{16}", str) //六位连续的数字 fmt. ...

  7. IOS的唯一标识符问题(转)

    引用地址 http://www.zhihu.com/question/22599526/answer/21938878 网上搜了下IOS手机标志的种类,直接引用过来. UDID [[UIDevice ...

  8. node.js模块的坑

    在写一个工具的时候,需要将xml转为json方便处理,以前电脑上装的node.js的版本为0.8,结果我再安装node-xml2json时提示版本过低,然后我又重装安装了最新版本. 然后再次尝试安装, ...

  9. c# action<> func<> 这2个委托怎么用和理解

    其实很好理解的呢!~首先你需要明白,他们是委托的简写形式. 一.[action<>]指定那些只有输入参数,没有返回值的委托 1.1定义一个委托: 比如,我们原来写委托: public de ...

  10. 在Redhat 7.3中采用离线方式安装Docker

    本文环境 Redhat Linux 7.3.Docker 18. 写在前面 Docker CE默认是不支持Redhat的,如果你想在Redhat安装,可以使用静态二进制包.这是我多次尝试RPM后得出的 ...