随笔分类 -  Python

摘要:软件中总免不了要使用诸如 Log4net, Log4j, Tracer 等东东来写日志,不管用什么,这些东东大多是大同小异的,一般都提供了这样5个日志级别: × Debug × Info × Warn × Error × Fatal 一个等级比一个高,但是在具体开发中,关于应该如何选择适应的等级,却... 阅读全文
posted @ 2015-05-15 16:28 成风魄郎 阅读(611) 评论(0) 推荐(0)
摘要:简单将日志打印到屏幕:[python]view plaincopyimportlogginglogging.debug('debugmessage')logging.info('infomessage')logging.warning('warningmessage')logging.error('... 阅读全文
posted @ 2015-05-15 16:12 成风魄郎 阅读(1164) 评论(0) 推荐(1)
摘要:1.常用内置函数:(不用import就可以直接使用) help(obj) 在线帮助, obj可是任何类型 callable(obj) 查看一个obj是不是可以像函数一样调用 repr(obj) 得到obj的表示字符串,可以利用这个字符串eval重建该对象的一个拷贝 eval_r(str) 表示合法的... 阅读全文
posted @ 2015-05-13 09:44 成风魄郎 阅读(279) 评论(0) 推荐(0)
摘要:二、知识点总结When themodel query APIsdon’t go far enough, you can fall back to writing raw SQL.go far enough:远远不够fall back to:求助raw:原始的,未加工的Django提供两种方式执行(p... 阅读全文
posted @ 2015-04-16 17:05 成风魄郎 阅读(1566) 评论(0) 推荐(0)
摘要:#!/usr/bin/python#coding:utf-8from django.shortcuts import render;from django.shortcuts import render_to_response;from django.http import HttpResponse... 阅读全文
posted @ 2015-04-16 14:37 成风魄郎 阅读(235) 评论(0) 推荐(0)
摘要:1 无参数情况配置URL及其视图如下:1234(r'^hello/$', hello)def hello(request): return HttpResponse("Hello World")访问http://127.0.0.1:8000/hello,输出结果为“Hello World”2 ... 阅读全文
posted @ 2015-04-16 14:35 成风魄郎 阅读(363) 评论(0) 推荐(0)
摘要:http://djangobook.py3k.cn/2.0/ 阅读全文
posted @ 2015-03-23 13:37 成风魄郎 阅读(120) 评论(0) 推荐(0)
摘要:http://www.tutorialspoint.com/execute_python_online.php 阅读全文
posted @ 2015-03-23 13:36 成风魄郎 阅读(300) 评论(0) 推荐(0)
摘要:4lib/matplotlib/__init__.pyView@@ -126,9 +126,9 @@ def compare_versions(a, b):else:return False-if not compare_versions(six.__version__, '1.5'):+... 阅读全文
posted @ 2014-09-12 10:43 成风魄郎 阅读(746) 评论(0) 推荐(0)
摘要:http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-dateutil 阅读全文
posted @ 2014-09-12 09:43 成风魄郎 阅读(1080) 评论(0) 推荐(0)
摘要:在使用NumPy进行学习统计计算时是枯燥的,大量的数据令我们很头疼,所以我们需要把它图形化显示。Matplotlib是一个Python的图形框架,类似于MATLAB和R语言。Matplotlib的官网地址是http://matplotlib.org/,下载地址为http://matplotlib.o... 阅读全文
posted @ 2014-09-12 09:27 成风魄郎 阅读(368) 评论(0) 推荐(0)
摘要:在使用NumPy进行学习统计计算时是枯燥的,大量的数据令我们很头疼,所以我们需要把它图形化显示。Matplotlib是一个Python的图形框架,类似于MATLAB和R语言。Matplotlib的官网地址是http://matplotlib.org/,下载地址为http://matplotlib.o... 阅读全文
posted @ 2014-09-12 09:27 成风魄郎 阅读(928) 评论(0) 推荐(0)
摘要:http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib 阅读全文
posted @ 2014-09-12 08:38 成风魄郎 阅读(454) 评论(0) 推荐(0)