随笔分类 - python
摘要:In [43]: s = 'axxxxxxxxxxxxxxxxxxxxxxxxxxxxx'In [44]: [s[idx:idx+4] for idx in range(len(s)) if idx%4==0]Out[44]: ['axxx', 'xxxx', 'xxxx', 'xxxx', '...
阅读全文
摘要:#单个unicode字符串的长度为1, 单个utf-8字符的长度为3 In [3]: u = u"这是一个中文字符串"In [4]: len(u)Out[4]: 9In [5]: utf8str = u.encode("utf-8")In [6]: len(utf8str)Out[6]: 27...
阅读全文
摘要:1. 问题现象, 通过web.input获取Form提交的请求, 发现后台并没有获取请求,并且通过firebug看到的content-length为0 web.py 代码如下: import weburls = ( '/','Index', '/commit', 'Commit'...
阅读全文

浙公网安备 33010602011771号