摘要: 单例模式 顾名思义,只有一个实例,如果存在了就不创建了 #!/usr/bin/env python# encoding: utf-8 class Singleton(): def __new__(cls,*args,**kwargs): if not hasattr(cls,'_inst'): cl 阅读全文
posted @ 2018-06-13 11:20 公众号python学习开发 阅读(156) 评论(0) 推荐(0) 编辑
摘要: web.py中文字符串网页显示乱码的解决 #!/usr/bin/env python # encoding: utf-8 import weburls = ( '/', 'index')class index: def GET(self): web.header('Content-Type', 't 阅读全文
posted @ 2018-06-13 10:15 公众号python学习开发 阅读(2224) 评论(0) 推荐(0) 编辑
摘要: 今天用pyhon安装完web.py的时候,点击运行还是没错的,但是在网页输入链接就会报错。1.安装我是这样的: pip install web.py 2.运行后错误信息是这样: AttributeError: module 'six.moves.urllib_parse' has no attrib 阅读全文
posted @ 2018-06-13 10:08 公众号python学习开发 阅读(1594) 评论(0) 推荐(0) 编辑