2017年9月13日

django urls

摘要: project_name/urls.py: from django.conf.urls import url,include from django.contrib import adminurlpatterns = [ url(r'^admin/', admin.site.urls), url(r 阅读全文

posted @ 2017-09-13 18:08 run_qin 阅读(136) 评论(0) 推荐(0) 编辑

django mysql settings

摘要: settings : DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'mydatabase', 'USER':'root', 'PASSWORD':'root', 'HOST':'127.0.0.1' 阅读全文

posted @ 2017-09-13 16:58 run_qin 阅读(102) 评论(0) 推荐(0) 编辑

2017年9月7日

数据库

摘要: all — 返回包含所有从模型基础表中获取的模型对象的 QuerySet。 filter — 返回仅包含那些与指定条件匹配的模型对象的 QuerySet。 exclude — 返回包含与指定条件不匹配的模型对象的 QuerySet。 get — 返回与指定条件匹配的单个模型对象。 departmen 阅读全文

posted @ 2017-09-07 16:26 run_qin 阅读(77) 评论(0) 推荐(0) 编辑

2017年7月12日

perimeter of squares

摘要: def perimeter(): n = 5nL = [1,1,]if n == 0: return 0if n == 1: return 1 * 4if n == 2: return 2 * 4rl = [nL.append(nL[i]+nL[i-1]) for i in range(1, n)] 阅读全文

posted @ 2017-07-12 15:27 run_qin 阅读(131) 评论(0) 推荐(0) 编辑

2017年7月10日

map

摘要: def order(): sentence = "is2 Thi1s T4est 3a" senList = str.split(sentence) nums = list(range(1, 10)) nums = map(str, nums) nums = list(nums) position 阅读全文

posted @ 2017-07-10 20:55 run_qin 阅读(265) 评论(0) 推荐(0) 编辑

django路由

摘要: project 下的urls 配置 阅读全文

posted @ 2017-07-10 11:09 run_qin 阅读(121) 评论(0) 推荐(0) 编辑

2017年7月8日

for的骚用法

摘要: 正常的def pig_it(): word = 'Pig latin is cool ' wordList = word.split() re = '' for item in wordList: if item.isalpha(): head = item[1:] ass = item[0]+'a 阅读全文

posted @ 2017-07-08 20:46 run_qin 阅读(155) 评论(0) 推荐(0) 编辑

2017年7月7日

3和5的倍数相加和

摘要: method1: def solu(num): 阅读全文

posted @ 2017-07-07 15:20 run_qin 阅读(199) 评论(0) 推荐(0) 编辑

PeteCake 字典和最小值

摘要: def cakes(recipe, available): # TODO: insert code count = [] for item in recipe: if item not in available: return 0 else: count.append(int(available[i 阅读全文

posted @ 2017-07-07 11:04 run_qin 阅读(137) 评论(0) 推荐(0) 编辑

Find the missing letter

摘要: charSet = set(chars) #去重复charSet = sorted(charSet) #排序charSet = ''.join(charSet) #转换成字符串flag = str.islower(charSet)charSet = str.lower(charSet)allChar 阅读全文

posted @ 2017-07-07 10:37 run_qin 阅读(375) 评论(0) 推荐(0) 编辑

导航