Set python procedure character as Unicode as below:The last thing is let quixote tell browser that the coming content should be encoded as UTF-8. Before return the content in function, add code "get_response().set_content_type("text/html", charset="utf-8")". In order to use get_resonse(), "from quixote import get_response" first.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
Set editor (Vim) as Unicode, add "set encoding=utf-8" in _vimrc.
Showing posts with label Quixote. Show all posts
Showing posts with label Quixote. Show all posts
Wednesday, April 11, 2007
Set content type and charset --Quixote
Friday, April 06, 2007
Quixote under Python2.5
Quixote终于可以在python2.5下用了。之前下载的Quixote2.4,在python2.5下无法运行simple demo,提示说ptl的参数有问题。没办法,只好在py2.4下用了。可是总是有点不甘心,于是加入quixote mailgroup,发了邮件询问quixote能否在py2.5下运行。信息返回得很快,mike提示quixote下的htmltext模块用C编译的,可能在py2.5下不兼容。我看了看,注释了demo里与ptl相关的函数和调用,没问题了。以为就这样解决了。后面有哥们说可以试试2.5a1的quixote,应该可以。我下载了,可是安装就出了问题,提示publish的module不存在。晕,发邮件说无法安装。另一个哥们马上发来2.5b1的下载地址。好像是因为文件上传的有问题。2.5b1完全没问题了,一切正常。再看看quixote主页上,也把2.5a1替换成2.b1版本了。
终于满足了高版本的虚荣心。下班前,在公司,也把之前作的应用全部升级到了python2.5。重新安装了一堆模块。
终于满足了高版本的虚荣心。下班前,在公司,也把之前作的应用全部升级到了python2.5。重新安装了一堆模块。
Subscribe to:
Posts (Atom)