摘要: 只要是可迭代的数据,包括字符串、文件、迭代器、生成器,都可进行数据分解: l = list(range(100)) first,_,third,*_,last = l 取出第1,3以及最后一个数据。 阅读全文
posted @ 2017-06-17 09:54 hehe1234567 阅读(484) 评论(0) 推荐(0) 编辑
摘要: web应用如用到ace等网络编辑器的时候,如要支持html,xml等格式的文件编辑,输入ace 的文本内容必须先进行html格式编码: def html_escape(content): import cgi return cgi.escape(content) 阅读全文
posted @ 2017-06-17 09:44 hehe1234567 阅读(1803) 评论(0) 推荐(0) 编辑