04 2018 档案
摘要:1.准备编译环境 2.下载 Python3.5代码包 3.做软链: 4.升级pip到最新版本: 注:--no-check-certificate 表示安装时“不检查证书”,不加上可能无法安装。 5.安装requests包: 6.安装pyquery包: 7.安装pymysql包: 6.安装django
阅读全文
摘要:switch ($type){ case 'day'://当日 $end=date('Y-m-d H:i:s',mktime(0,0,0,date('m'),date('d')+1,date('Y'))); $where=' and '.$pre.'create_time>="'.date('Y-m-d').'" and '.$pre.'create_ti...
阅读全文
摘要:switcher ={ 0:'sunday', 1:'monday', 2:'thuesday' } day = 0 day_name=switcher.get(day,'Unknow') print(day_name) # sunday def get_sunday(): return 'sunday' def get_monday(): retur...
阅读全文
摘要:# map #reduce # filter # 装饰器
阅读全文
摘要:# from enum import Enum # 枚举 # class VIP(Enum): # YELLOW = 1 # YELLOW_ALIAS = 1 # 别名 # GREEN = 2 # BLACK = 3 # RED = 4 # print(VIP.GREEN) # VIP.GREEN8VIP.GREEN # print(VIP...
阅读全文
摘要:import json # json反序列化 # json_str = '{"name":"qiyue","age":18}' # student = json.loads(json_str) # print(type(student)) # # print(student) # {'name': 'qiyue', 'age': 18} # print(student['...
阅读全文
摘要:# 1.检查一串数字是否是电话号码 # 2.检查一个字符串是否符合email # 3.把一个文本里指定的单词替换为另一个单词 import re # a = 'C|C++|Java|C#|Python|Javascript' # print(a.index('Python') > -1) # True # print('Python' in a) # True # r=r...
阅读全文
摘要:# 函数 # 1.功能性 # 2.隐藏细节 # 3.避免编写重复代码 # 4. # print() # round() a = 1.12386 # 保留3位小数 result=round(a,3) print(result) # 定义函数 # def funcname(paramter_list) # pass # 1.参数列表可以没有 # 2.return value none...
阅读全文