十八、python self.write
来源:互联网 发布:php高并发是什么意思 编辑:程序博客网 时间:2024/05/22 13:53
从handler向前端返回信息可以使用 self.write({'result':'1', 'message':'get mannully issues error'})
如果你有多行代码,例如:
try: xxxxxxxx except Exception, e: traceback.print_exc() self.write({'result':'1', 'message': 'failed'}) **return**if resBool is True: self.write({'result':'0', 'message': 'success'})else: self.write({'result':'1', 'message': 'failed'})
像这种情况一定别要忘了在self.write之后加上return,别问我怎么知道的
参考文档:
do中finish和write区别 http://sls0919.iteye.com/blog/1911472
阅读全文
0 0
- 十八、python self.write
- Python Self
- python self
- python self
- python self
- Python self
- python __str__(self) __unicode__(self)
- 【python】Python中的self
- 重拾Python 十八
- python学习(十八)
- python self __init__
- python里的self
- Python self 详解
- Python 为什么要self
- Python为什么要self
- python中的self
- Python为什么要self
- Python魔术师--self
- Mac firefox 插件Adobe Flash已崩溃 重新载入页面以再试一次 Shockwave Flash has crashed.
- 5分钟理解udev
- openfire安装和部署
- GitHub上搭建博客&增加相册功能
- appium启动app启动的activity的方法总结
- 十八、python self.write
- laravel稀罕的Eloquent模型的用法
- 使用tolua++实现C++与LUA相互调用
- c++表达式求值(利用数据结构栈)
- java使用Formatter的时候中英文格式不能对齐
- solr 在非集群模式下 core和collection是一样的
- BZOJ3928: [Cerc2014] Outer space invaders(区间DP)
- solr优化
- linux-tail