Python
junfeng_feng
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python 随想一些有用feature
#coding=gbkimport os #operating systemimport sys #systemimport copyfrom pprint import pprint #perfect print from operator import attrgettera = [1, 2, 3, 4, 5]b = [6, 7, 8, 9, 10]#python使用引用计原创 2012-05-29 20:29:14 · 836 阅读 · 0 评论 -
web.py 直接使用示例代码,web.application报错, 'module' object has no attribute 'application',问题原因分析
import weburls = ( '/', 'index')class index: def GET(self): return "Hello, world!"if __name__ == "__main__": app = web.application(urls, globals()) app.run()原创 2015-01-22 22:50:18 · 7430 阅读 · 0 评论 -
Python 50行代码实现代理服务器(加强版)
Python 50行代码实现代理服务器(加强版)原创 2015-01-21 13:36:33 · 10440 阅读 · 1 评论 -
Information Gain 计算 python实现
from math import logdef I(*args): total = sum(args) + 0.0 result = 0.0 for i in args: if i == 0: result += 0 else: result += i / total * log( i /原创 2012-06-10 16:06:38 · 5399 阅读 · 0 评论 -
python3.7, django2.2.1, pymysql替换MySQLdb
第一步在项目的__init__.py,添加如下两行,使用pymysql替换mysqldbimport pymysqlpymysql.install_as_MySQLdb()第二步发现还是报错,错误原因是pymysql虽然替换了mysqldb,但是版本号pymysql版本号低于mysqldb太多。django.core.exceptions.ImproperlyConf...原创 2019-05-06 14:46:01 · 1279 阅读 · 1 评论
分享