摘要: 面向过程 以指令为中心,有指令处理数据 如何组织代码,解决问题 面向对象 以数据为中心,所有的数据代码都围绕数据展开 如何设计数据结构,并且提供此类 tupple( ) 元祖 list 列表 dict 字典 一、函数 核心数据类型 数字: int long float bool 字符 str 列表 阅读全文
posted @ 2017-02-16 16:10 邹文强 阅读(99) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python # -*- coding:utf-8 -*- __author__ = 'zwq' __data__ = '2017/2/16 11:46' from random import randint,sample li1 = sample('abcdefg',randint(3,6)) # 随机取样 s1 = {x:randint(1,4) for x... 阅读全文
posted @ 2017-02-16 15:41 邹文强 阅读(93) 评论(0) 推荐(0) 编辑
摘要: {'lile':79,'jim':88} 阅读全文
posted @ 2017-02-16 11:46 邹文强 阅读(109) 评论(0) 推荐(0) 编辑
摘要: # 2 命名的元祖from collections import namedtupleStudent = namedtuple('Student',['name','age','sex','email'])s = Student('jimi',16,'role','jian@qq.com')s.ag 阅读全文
posted @ 2017-02-16 11:02 邹文强 阅读(134) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python # -*- coding:utf-8 -*- #2.1 如何在列表,字典,集合中根据天剑筛选数据 # 帅选列表中符合条件的项 data = [1,5,-3,-2,6,8,0,9] res = [] for x in data: if x >=0: res.append(x) # print(res) #2 from rando... 阅读全文
posted @ 2017-02-16 10:59 邹文强 阅读(146) 评论(0) 推荐(0) 编辑
摘要: From 代码 Model 代码 对应的模板代码 注意: :<form ... enctype="multipart/form-data"> 这样才能传图片的撒! 阅读全文
posted @ 2017-02-14 12:57 邹文强 阅读(686) 评论(0) 推荐(0) 编辑