09 2017 档案

摘要:import pymysql,redisdef OpertioMsql(host,user,passwd,db,sql,port=3306,charset='utf8'): conn = pymysql.connect(host=host,user=user,passwd=passwd,port=p 阅读全文
posted @ 2017-09-29 16:51 13684995613 阅读(189) 评论(0) 推荐(0)
摘要:def maoPao(list): print(list) for a in range(len(list)): #控制外循环次数 for i in range(a): #循环列表内容 if list[i]>list[i+1]: #前一个数和后一个数进行对比 list[i],list[i+1]=li 阅读全文
posted @ 2017-09-25 17:49 13684995613 阅读(175) 评论(0) 推荐(0)
摘要:一、os模块>>> os.getcwd() #获取当前路径'C:\\Users\\xiu\\AppData\\Local\\Programs\\Python\\Python36-32'>>> os.chdir('C:\\Users\\xiu\\AppData\\Local\\Programs\\Py 阅读全文
posted @ 2017-09-22 18:02 13684995613 阅读(167) 评论(0) 推荐(0)
摘要:#1、python中使用正则表达式步骤:import re #导入正则表达式模块# ff = re.compile(r'\d{3}-\d{3}-\d{4}') #用compile函数创建一个Regex对象# gg = ff.search('my phone is:075-333-4466') #像R 阅读全文
posted @ 2017-09-14 15:57 13684995613 阅读(196) 评论(0) 推荐(0)
摘要:# 1.像列表一样,字典是许多值的集合,存储方式“键-值”对# mycat = {'size':'fat','color':'red','disposition':'loud'}# 这个字典的键:size、color、disposition# 这个字典的值:fat、red、loud# 根据“键”获取 阅读全文
posted @ 2017-09-13 17:30 13684995613 阅读(183) 评论(0) 推荐(0)