2018年2月4日

python--生成测试数据

摘要: 1.方法 阅读全文

posted @ 2018-02-04 16:41 我要的明天 阅读(379) 评论(0) 推荐(0) 编辑

python--get_data_from_csv_or_txt

摘要: 一、从csv文件中获取 阅读全文

posted @ 2018-02-04 16:37 我要的明天 阅读(443) 评论(0) 推荐(0) 编辑

python--zip

摘要: import os, zipfile# @params 文件夹路径,压缩后的文件路径名def dir_zip(dirname, zipfilename): filelist = [] if os.path.isfile(dirname): filelist.append(dirname) else: 阅读全文

posted @ 2018-02-04 16:31 我要的明天 阅读(158) 评论(0) 推荐(0) 编辑

python--time

摘要: import datetime#获取当前日期def get_date(): date = datetime.datetime.strftime(datetime.datetime.now(),'%Y%m%d') return date#获取当前时间def get_date_time(): date_time = datetime.datetime.strftime(datet... 阅读全文

posted @ 2018-02-04 16:30 我要的明天 阅读(187) 评论(0) 推荐(0) 编辑

python--excel

摘要: import xlrd, xlwt# 读取Exceldef read_excel(excel_name, sheet_name): if excel_name and excel_name: all_data_list = [] try: workbook = xlrd.open_workbook(excel_name) ... 阅读全文

posted @ 2018-02-04 16:29 我要的明天 阅读(190) 评论(0) 推荐(0) 编辑

python--sha256

摘要: import hmacimport hashlibdef get_hmacsha256(key, message): key_bytes = bytes(key, 'utf-8') message_bytes = bytes(message, 'utf-8') hmacsha256_str = hmac.new(key_bytes, message_bytes, digest... 阅读全文

posted @ 2018-02-04 16:29 我要的明天 阅读(840) 评论(0) 推荐(0) 编辑

python--base64

摘要: import base64import os# base64,参数为文件路径名def file_base64(filepath): if os.path.isfile(filepath): with open(filepath, 'rb') as file: file_base64_str = ba 阅读全文

posted @ 2018-02-04 16:28 我要的明天 阅读(210) 评论(0) 推荐(0) 编辑

python--md5

摘要: import hashlibimport os#字符串md5def string_md5(str_value): if str_value: hashmd5 = hashlib.md5() hashmd5.update(str_value.encode('utf-8')) str_md5 = has 阅读全文

posted @ 2018-02-04 16:27 我要的明天 阅读(266) 评论(0) 推荐(0) 编辑

python--操作数据库

摘要: 一、连接MySQL 阅读全文

posted @ 2018-02-04 16:23 我要的明天 阅读(214) 评论(0) 推荐(0) 编辑

python--多线程

摘要: import threadingfrom time import ctimeclass MyThread(threading.Thread): def __init__(self, func, args, name=''): threading.Thread.__init__(self) self. 阅读全文

posted @ 2018-02-04 11:05 我要的明天 阅读(141) 评论(0) 推荐(0) 编辑

导航