tornado和telegraphy的helloworld

参考 http://www.tornadoweb.cn/

tar xvzf tornado-1.2.1.tar.gz
cd tornado-1.2.1
python setup.py build
sudo python setup.py install

helloworld

import tornado.ioloop
import tornado.web

class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")

application = tornado.web.Application([
(r"/", MainHandler),
])

if __name__ == "__main__":
application.listen(8888)
tornado.ioloop.IOLoop.instance().start()

python hello.py
curl localhost:8888

websocket的
https://github.com/hiroakis/tornado-websocket-example
不好使.是因为需要国外使用google的js

-------------------------------------------------------------


尝试https://github.com/machinalis/telegraphy/
注意
[color=red]https://github.com/machinalis/telegraphy/blob/master/developer_requirements.txt[/color]
这里说了依赖,依赖不对装不对呀
比如
pip install django_extensions==1.1.1


virtualenv telegraphy
. telegraphy/bin/activate
pip install zope.interface
yum install bzip2-devel
cp /usr/lib64/python2.6/lib-dynload/bz2.so /data/mysocket/python/telegraphy/telegraphy/lib/python2.7/
pip install flake8==2.0
pip install django-nose==1.1
pip install ipdb==0.8
pip install mock==1.0.1
pip install django_extensions==1.1.1


[code="java"]virtualenv telegraphy
. telegraphy/bin/activate
pip install zope.interface
yum install bzip2-devel
cp /usr/lib64/python2.6/lib-dynload/bz2.so /data/mysocket/python/Telegraphy/telegraphy/lib/python2.7/
pip install six
pip install six --upgrade
pip install telegraphy
pip install telegraphy --upgrade
pip install django_extensions
pip install pysqlite
pip install listenWS
(telegraphy)# pwd
/data/mysocket/python/Telegraphy/git/telegraphy/demo_project
(telegraphy)# python manage.py run_telegraph
[/code]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值