摘要:
def is_dui_chen(st): st = str(st) for i in range(len(st) // 2): if st[i] == st[-1 - i]: return True else: return Falseprint(is_dui_chen('3ab6ba3')) 阅读全文
posted @ 2018-10-29 17:33
laosun0204
阅读(1253)
评论(0)
推荐(0)
摘要:
列表中只有一个最大长度的字符串和一个最小长度的字符串 def get_ele_len(): data = ['hello', 'blue', 'fly', 'watermelon', 'sun', 'computer', 'money'] lis = [] for i in data: lis.ap 阅读全文
posted @ 2018-10-19 09:50
laosun0204
阅读(1199)
评论(0)
推荐(0)
摘要:
按顺序获取key的值 data = {'a': 7, 'c': 10, 'b': 9}key = []for i in sorted(data): key.append(i[0])print(key) 按key顺序获取字典 dic = {}dict_num = {1: 2, 14: 45, 6: 1 阅读全文
posted @ 2018-10-18 17:36
laosun0204
阅读(303)
评论(0)
推荐(0)
摘要:
def get_ele_len(): d = ['wanba', 'zhang23yiminlove1244', 'liuxiaokang', 'feilong', 'cuijiaming', 'wanghongxinglove12345', 'hongxing', 'chenxin', 'zhan 阅读全文
posted @ 2018-10-18 16:54
laosun0204
阅读(4373)
评论(0)
推荐(0)
摘要:
# 第一种方法:用set方法 a = [1, 1, 2, 2, 3, 4, 5, 5, 5, 6, 7, 6]b = set(a)print(b) # 第二种方法:列表生成式去重 list1 = [1, 1, 2, 2, 3, 4, 5, 5, 5, 6, 7, 6]list2 = [][list2 阅读全文
posted @ 2018-10-16 10:00
laosun0204
阅读(297)
评论(0)
推荐(0)
摘要:
python安装时要把两个目录放到环境变量里:1、python的安装目录2、python安装目录下面的scripts目录 pycharm配置: 按照File->Settings->Editor->Colors & Fonts->Fonts这个路径修改字体和颜色,先点击Save As,然后在修改,修改 阅读全文
posted @ 2018-10-08 09:47
laosun0204
阅读(1060)
评论(0)
推荐(0)
摘要:
linux下安装jmeter步骤: 1、通过ftp将上传到Linux的root目录下 2、修改权限,chmod -R 777 jdk-6u45-linux-i586.bin 3、安装jdk命令:在root目下输入./ jdk-6u45-linux-i586.bin 4、配置环境变量:vi /etc/ 阅读全文
posted @ 2018-10-07 14:13
laosun0204
阅读(374)
评论(0)
推荐(0)
摘要:
import yagmail# 发送邮件,user为发送邮件的邮箱名,password为邮箱授权码,host为邮箱服务器,cc为抄送的邮箱# to为接收者的邮箱多个邮箱用list,subject为邮件标题,contents为邮件正文,attachments为邮件带的附件(即生成的最新的报告)clas 阅读全文
posted @ 2018-10-06 23:15
laosun0204
阅读(173)
评论(0)
推荐(0)
摘要:
import pymysqlimport redisimport requestsimport hashlibimport osfrom lib.path import APP_REPORTclass MyMysql(object): def __init__(self, host, port, u 阅读全文
posted @ 2018-10-06 23:12
laosun0204
阅读(157)
评论(0)
推荐(0)
摘要:
import unittestfrom page.thread_page import Pageimport timeclass ThreadDemo(unittest.TestCase): def __repr__(self): # _repr_函数,对应repr(object)这个函数,返回一个 阅读全文
posted @ 2018-10-06 22:28
laosun0204
阅读(144)
评论(0)
推荐(0)
浙公网安备 33010602011771号