上一页 1 ··· 4 5 6 7 8 9 下一页

2018年2月26日

摘要: 当运行scrapy crawl spider 时,会生成一个crawl命令对象,scrapy是调用execute函数(cmdlin.py)来执行命令的,execute函数会给命令对象添加crawler_process属性(cmd.crawler_process = CrawlerProcess(se 阅读全文

posted @ 2018-02-26 16:16 王将军之武库 阅读(533) 评论(0) 推荐(0) 编辑


2018年2月25日

摘要: scrapy.Request(url, self.parse_detail) Request对象有回调函数。Request对象放到scheduler的队列中,engine会从schedule中取得request。 scrapy的crawl命令调用的函数 C:\Python27\Lib\site-pa 阅读全文

posted @ 2018-02-25 23:04 王将军之武库 阅读(249) 评论(0) 推荐(0) 编辑


2018年2月24日

摘要: python 包 多个关系密切的模块应该组织成一个包,以便于维护和使用。这项技术能有效避免名字空间冲突。创建一个名字为包名字的文件夹并在该文件夹下创建一个__init__.py 文件就定义了一个包。你可以根据需要在该文件夹下存放资源文件、已编译扩展及子包。举例来说,一个包可能有以下结构: Graph 阅读全文

posted @ 2018-02-24 21:32 王将军之武库 阅读(270) 评论(0) 推荐(0) 编辑

摘要: def get_handler(self, *args, **options): return get_internal_wsgi_application() def get_internal_wsgi_application(): from django.conf import settings 阅读全文

posted @ 2018-02-24 18:42 王将军之武库 阅读(606) 评论(0) 推荐(0) 编辑


2018年2月23日

摘要: """Generic socket server classes. This module tries to capture the various aspects of defining a server: For socket-based servers: - address family: - AF_INET{,6}: IP (Internet Protocol) s... 阅读全文

posted @ 2018-02-23 23:00 王将军之武库 阅读(263) 评论(0) 推荐(0) 编辑

摘要: django的signal在djangobb中的使用: 以上代码使得每次新建一个post时,都会修改topic的内容 修饰器receiver调用信号的connect函数,添加了信号的处理器。 signal调用send函数时就会调用到signal的receiver,那post_save信号的send函 阅读全文

posted @ 2018-02-23 21:15 王将军之武库 阅读(247) 评论(0) 推荐(0) 编辑

摘要: django的模板编译后变成一般text、tag、varible,然后根据上下文进行渲染。 class ForNode(Node): child_nodelists = ('nodelist_loop', 'nodelist_empty') def __init__(self, loopvars, 阅读全文

posted @ 2018-02-23 18:11 王将军之武库 阅读(224) 评论(0) 推荐(0) 编辑

摘要: context作为view与template之间的桥梁,理解它的工作原理对于djagno的模板工作机制至关重要。 class ContextDict(dict)是用来保存数据的,它连接了context与dicts,该类可以作为with语句表达式。 class Context(BaseContext) 阅读全文

posted @ 2018-02-23 16:45 王将军之武库 阅读(2072) 评论(0) 推荐(1) 编辑

摘要: python的with语句相当于try.....finally,它是如何实现的呢?下面就结合范例和伪指令的实现来分析一下。 with语句会汇编成:先调用with语句后面的表达式(open(...)),再与open的返回结果作为setup_with的参数,从setup_with的实现源码来看,它是先找 阅读全文

posted @ 2018-02-23 10:35 王将军之武库 阅读(158) 评论(0) 推荐(0) 编辑


2018年2月9日

摘要: 因为markdown,我接触到latex,因为latex,我花了几个月去看相关的书籍 我看了以下相关的资料 1.《LaTeX入门》 刘海洋 2.英文 TeX LaTeX Stack Exchange 3.中文 CTEX社区 高尔基 书籍是人类进步的阶梯 兴趣是最好的老师 阅读全文

posted @ 2018-02-09 09:10 王将军之武库 阅读(129) 评论(0) 推荐(0) 编辑


上一页 1 ··· 4 5 6 7 8 9 下一页

Copyright © 2025 王将军之武库
Powered by .NET 9.0 on Kubernetes