摘要: 1.数据库驱动:给database >data source下载对应数据库的驱动。 2.数据库工具包:py2.0支持MySQLdb(),但是py3中MySQLdb()已经不能完全适用,需要置换,毕竟orm底层上还是基于关于数据库操作的py工具包,请先确保已经下载好了pymysql,在项目文件夹下的_ 阅读全文
posted @ 2018-10-15 23:17 云朵路过你的城南 阅读(182) 评论(0) 推荐(0)
摘要: 1:在app文件下新建templatetags,文件名不可改,django运行时会自动寻址。 2:templatetags下新建py文件。 3:py文件里需要引用申明:from django import template // 引入模板 from django.utils.safestring i 阅读全文
posted @ 2018-10-14 13:39 云朵路过你的城南 阅读(143) 评论(0) 推荐(0)
摘要: 1 2 3 4 5 > 1 2 3 4 5 > 阅读全文
posted @ 2018-09-28 16:52 云朵路过你的城南 阅读(120) 评论(0) 推荐(0)
摘要: def maxsum(list): max=list[0] for i in range(0,len(list)): //子序列开始位置 sum=list[i] for j in range(i+1,len(list)): //子序列结束位置 sum+=list[j] //子序列求和 if sum> 阅读全文
posted @ 2018-09-28 11:31 云朵路过你的城南 阅读(1925) 评论(0) 推荐(0)
摘要: 如下是一段简单的左侧菜单html代码<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"><title>Title</title><script src="jquery-3.3.1.min.js"></script><style> . 阅读全文
posted @ 2018-09-20 23:29 云朵路过你的城南 阅读(230) 评论(0) 推荐(0)
摘要: js下:<script> data=["南京","南通"] for( var item in data){ console.log(item)}</script></html>得到:01得到的是data数组两个元素的序号。Python下: data=["南京","南通"]for item in da 阅读全文
posted @ 2018-09-18 21:53 云朵路过你的城南 阅读(968) 评论(0) 推荐(0)
摘要: import threadpool,os #threadpool需要pip安装def foo(i): print("son process %d %s"%(i,os.getpid())) return idef back(req,a): #俩个参数,一个是运行函数foo的返回值,还有输入一个requ 阅读全文
posted @ 2018-08-28 23:07 云朵路过你的城南 阅读(334) 评论(0) 推荐(0)
摘要: 编译型语言:通过编译器,将源代码编译成二进制语言文件,机器更易执行,效率高,调试修改比较麻烦。 解释性语言:源代码在执行中通过解释器翻译成机器语言,每执行一次解释器解释一次,效率低且解释器运行需要占据cup和内存,但灵活,易于调试修改。 python:cpython是基于C语言开发的解释器,应用最广 阅读全文
posted @ 2018-08-27 11:51 云朵路过你的城南 阅读(272) 评论(0) 推荐(0)