Python RESTful Service(1)Twisted Version Upgrade

本文介绍了如何使用 Python 的 Twisted 框架搭建 RESTful 服务,包括 Twisted 版本检查、安装配置过程及一个名为 sillycat-prest 的示例项目运行方法。此外还提到了 Tornado 作为另一种实现方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Python RESTful Service(1)Twisted Version Upgrade

Check Python version and Pip Version
>python -V
Python 2.7.13

>pip -V
pip 9.0.1 from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (python 2.7)

Make sure pip is the latest
>pip install -U setuptools
>pip install -U pip

Install twisted on my command line tool environment
Try to fetch the latest version right now.
>wget https://twistedmatrix.com/Releases/Twisted/17.1/Twisted-17.1.0.tar.bz2
Unzip that and move to the working directory

Install from the source
>python setup.py install Or >pip install Twisted

Verify the installation
>>> import twisted
>>> print twisted.version
[Twisted, version 17.1.0]

I have a sample project called sillycat-prest. And there is command to run that
>python restapi/com/sillycat/prestapi/RestAPI.py

But it seems a lot of work to do after we have the twisted.

Let’s try https://github.com/tornadoweb/tornado


References:
twisted
http://sillycat.iteye.com/blog/2243749
http://sillycat.iteye.com/blog/2243775
http://sillycat.iteye.com/blog/2244167
http://sillycat.iteye.com/blog/2244169

tornado
http://www.tornadoweb.org/en/stable/guide.html official document
https://segmentfault.com/a/1190000002703128
https://segmentfault.com/a/1190000002703321
https://segmentfault.com/a/1190000002705416
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值