摘要: 今天 today = datetime.date.today() 昨天 yesterday = today - datetime.timedelta(days=1) 上个月 last_month = today.month - 1 if today.month - 1 else 12 当前时间戳 t 阅读全文
posted @ 2019-12-06 15:56 一只竹子 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 遍历技巧 在字典中遍历时,关键字和对应的值可以使用 items() 方法同时解读出来: >>> knights = {'gallahad': 'the pure', 'robin': 'the brave'}>>> for k, v in knights.items():... print(k, v 阅读全文
posted @ 2019-11-22 15:34 一只竹子 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 列表 Python中列表是可变的,这是它区别于字符串和元组的最重要的特点,一句话概括即:列表可以修改,而字符串和元组不能。 以下是 Python 中列表的方法: 方法描述 list.append(x) 把一个元素添加到列表的结尾,相当于 a[len(a):] = [x]。 list.extend(L 阅读全文
posted @ 2019-11-22 14:53 一只竹子 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 集合内置方法完整列表 方法描述 add() 为集合添加元素 clear() 移除集合中的所有元素 copy() 拷贝一个集合 difference() 返回多个集合的差集 difference_update() 移除集合中的元素,该元素在指定的集合也存在。 discard() 删除集合中指定的元素 阅读全文
posted @ 2019-11-20 16:28 一只竹子 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 字典内置函数&方法 Python字典包含了以下内置函数: 序号函数及描述实例 1 len(dict)计算字典元素个数,即键的总数。 >>> dict = {'Name': 'Runoob', 'Age': 7, 'Class': 'First'} >>> len(dict) 3 2 str(dict 阅读全文
posted @ 2019-11-20 14:50 一只竹子 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 元组内置函数 Python元组包含了以下内置函数 序号方法及描述实例 1 len(tuple)计算元组元素个数。 >>> tuple1 = ('Google', 'Runoob', 'Taobao') >>> len(tuple1) 3 >>> 2 max(tuple)返回元组中元素最大值。 >>> 阅读全文
posted @ 2019-11-20 14:42 一只竹子 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Python列表函数&方法 Python包含以下函数: 序号函数 1 len(list)列表元素个数 2 max(list)返回列表元素最大值 3 min(list)返回列表元素最小值 4 list(seq)将元组转换为列表 Python包含以下方法: 序号方法 1 list.append(obj) 阅读全文
posted @ 2019-11-20 14:36 一只竹子 阅读(403) 评论(0) 推荐(0) 编辑
摘要: import parameterizedimport unittestimport parameterizedimport unittest,BeautifulReport#数据驱动#代码驱动#关键字驱动data = [ ['admin','123456',True], ['admin','1122 阅读全文
posted @ 2019-11-19 23:25 一只竹子 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 1、搭建测试环境 1、申请服务器 2、安装依赖的软件 jdk1.8、mysql、redis、tomcat等等 3、获取代码,修改配置文件,(编译、打包) 4、导入基础数据(建表、导入数据) 5、代码放到服务器上,启动 2、日常部署 1、拉取最新代码,修改配置文件,(编译、打包) 2、如果有变动的sq 阅读全文
posted @ 2019-11-19 23:16 一只竹子 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 虚拟环境: pip install virtualenv e://virtual_envs #建个文件夹专门放虚拟环境的 cd e://virtual_envs virtualenv py3 #干净的环境,没有第三方模块,只有pip cd /User/virtual_envs/py3/bin #进入 阅读全文
posted @ 2019-11-19 23:13 一只竹子 阅读(106) 评论(0) 推荐(0) 编辑