摘要: 新建Django工程 1 django-admin.exe startproject mysite 新建static(静态模板文件存储路径) setting中配置static路径 1 STATICFILES_DIRS = ( 2 os.path.join(BASE_DIR,'static'), 3 阅读全文
posted @ 2018-01-11 23:31 cerofang 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 选择器 关于选择id 执行过程(console中) 2,class 执行过程 3,标签(组合选择器) 执行代码 执行结果 4, 1 :first 2 V1.0概述 3 获取第一个元素 4 示例 5 描述: 6 获取匹配的第一个元素 7 HTML 代码: 8 <ul> 9 <li>list item 阅读全文
posted @ 2018-01-04 22:59 cerofang 阅读(219) 评论(0) 推荐(0) 编辑
摘要: >>>插入图片一个完全覆盖一个有上下左右滚动条 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Title</title> 6 </head> 7 <body> 8 <div style= 阅读全文
posted @ 2017-12-25 23:26 cerofang 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 》》》基本方法 1 from urllib import request 2 3 response = request.urlopen("https://movie.douban.com/top250?start=25&filter=") 4 content = response.read().de 阅读全文
posted @ 2017-12-22 23:19 cerofang 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 下载网址,版本号database version 5.7.20 w10 系统安装过程 安装过程错误部分从登陆进MySQL开始,重置初始密码命令为 参考链接 》》》》》数据库链接实例获取数据库版本号及sql安装自带databases表 1 import MySQLdb 2 def conn_conne 阅读全文
posted @ 2017-12-16 21:12 cerofang 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 》》》》》基础rabbitMQ数据交互 1 import pika 2 connection = pika.BlockingConnection( 3 pika.ConnectionParameters('localhost') 4 ) 5 channel = connection.channel( 阅读全文
posted @ 2017-12-13 22:54 cerofang 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 》》》》》携程greenlet模块 1 from greenlet import greenlet 2 def test1(): 3 print(15) 4 gr1.switch() 5 print(16) 6 gr1.switch() 7 def test2(): 8 print(25) 9 gr 阅读全文
posted @ 2017-12-13 21:31 cerofang 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 》》》》线程中的queue 1,父线程中生成一个q,子线程可以直接对q中的数据进行访问,访问完后父线程可以对子线程放入的数据进行操作,即数据实现了共享 》》》》》》》》进程中的queue 1,区别线程中的queue和进程中的Queue的不同 》》》》》》》》》》》》》》》》Pipe 1,parent 阅读全文
posted @ 2017-12-11 23:06 cerofang 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 1,实现了多线程的并发,主进程在等待各个线程执行结束之后才继续往下执行 2 ,t.join()让进程等待当前线程结束。 3 ,线程的实例 》》》》》》》》》》》》》线程2 1,类的方式定义多线程并发 》》》》》》》》线程3 1,t.setDaemon(True)#把当前线程设置为守护线程 2,thr 阅读全文
posted @ 2017-12-10 22:22 cerofang 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1 import threading,time 2 3 def run(n): 4 semaphore.acquire() 5 time.sleep(1) 6 print("run in the %s thread"%n) 7 semaphore.release() 8 9 if __name__ == '__main__': 10 ... 阅读全文
posted @ 2017-12-09 23:12 cerofang 阅读(117) 评论(0) 推荐(0) 编辑