02 2014 档案
摘要:I spent several days on building a system about this. And make it work well with serveral thousand lines of codes.
阅读全文
摘要:先说说思路一、安装这些东西,tornado, supervisor( sudo pip install supervisor 在linux 系统上), 安装 nginx (sudo apt-get install nginx -y)二、让supervior 和 已经写好的tornado 服务挂钩用supervisor 来管理服务和进程在命令行里面使用。然后,再在 supervisord.conf 最后面添加这几行这里tornado center.py 的本地服务地址是8100,写在center.py 文件里面了。当然为了标准,我们可以添加这几行在这里面,用来产看进程id,还有进程log(uni
阅读全文
摘要:题外话: 这里分享一个链接是将Flask 和 Apache 用 mod_wsgi 来进行传唤的部署方式,在digital ocean VPS 上的。https://www.digitalocean.com/community/articles/how-to-deploy-a-flask-application-on-an-ubuntu-vps挺不错的。但是对于tornado 来说,我们最好是采用tornado 和 nginx,因为“Tornado 对WSGI只提供了有限的支持,即使如此,因为 WSGI 并不支持非阻塞式的请求,所以如果你使用 WSGI 代替 Tornado 自己的 HTTP 服
阅读全文
摘要:原文这里有显示地址:http://zhou123.blog.51cto.com/4355617/1312791现在摘取一部分:这里介绍一下python执行shell命令的四种方法:1、os模块中的os.system()这个函数来执行shell命令123>>> os.system('ls')anaconda-ks.cfg install.log install.log.syslog send_sms_service.py sms.py0注,这个方法得不到shell命令的输出。2、popen()#这个方法能得到命令执行后的结果是一个字符串,要自行处理才能得到想要的
阅读全文