04 2015 档案

摘要:Part 4: Forms and generic views====> Write a simple form$ edit polls\templates\polls\detail.html{{ question.question_text }}{% if error_message %}{{ e... 阅读全文
posted @ 2015-04-28 16:03 罗兵 阅读(344) 评论(0) 推荐(0) 编辑
摘要:HomeMove cursor to the beginning of the line currently on.EndMove cursor to the end of the line currently on.Ctrl + UpScroll up one line.Ctrl + DownSc... 阅读全文
posted @ 2015-04-28 12:20 罗兵 阅读(870) 评论(0) 推荐(0) 编辑
摘要:Part 3: Views and templates====> Write your first view$ edit polls\views.pyfrom django.http import HttpResponsedef index(request): return HttpResponse... 阅读全文
posted @ 2015-04-28 02:32 罗兵 阅读(582) 评论(0) 推荐(0) 编辑
摘要:Part 2: The admin site ====> Creating an admin user$ python manage.py createsuperuser Username: admin Email address: admin@example.com Password: *****... 阅读全文
posted @ 2015-04-27 15:53 罗兵 阅读(389) 评论(0) 推荐(0) 编辑
摘要:Django 特点强大的数据库功能 用python的类继承,几行代码就可以拥有一个丰富,动态的数据库操作接口(API),如果需要你也能执行SQL语句自带的强大的后台功能 几行简单的代码就让你的网站拥有一个强大的后台,轻松管理你的内容!优雅的网址 用正则匹配网址,传递到对应函数,随意定义,如你所想!模... 阅读全文
posted @ 2015-04-27 03:13 罗兵 阅读(599) 评论(0) 推荐(0) 编辑
摘要:1、Process类from multiprocessing import Processdef func(name): print('hello', name)if __name__ == '__main__': p = Process(target=func, args=('bob'... 阅读全文
posted @ 2015-04-10 17:10 罗兵 阅读(664) 评论(0) 推荐(0) 编辑
摘要:为了解决阻塞(如I/O)问题,我们需要对程序进行并发设计。本文将通过将线程和队列 结合在一起,轻松地在 Python 中完成线程编程,创建一些简单但有效的线程使用模式。一、使用线程先看一个线程不多的例子,不存在阻塞,很简单:import threadingimport datetimeclass M... 阅读全文
posted @ 2015-04-10 12:09 罗兵 阅读(588) 评论(0) 推荐(0) 编辑
摘要:import requestsimport refrom lxml import etree'''噢百万抓取'''url = 'http://www.obaiwan.com/hk49/results/'p = re.compile('''\r\n.+?\r\n(.+?)\r\n(.+?)\r\n(.... 阅读全文
posted @ 2015-04-08 15:03 罗兵 阅读(844) 评论(0) 推荐(0) 编辑
摘要:本文是学习数据结构的笔记。【效果图】【代码】# example.py# 算法时间复杂度示例def func_01(n): ''' 时间复杂度O(Log(Log(N))) ''' import math i = n count = 0 while i > 1: ... 阅读全文
posted @ 2015-04-04 00:55 罗兵 阅读(733) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示