- 博客(11)
- 收藏
- 关注
原创 python类似列表的str转换为list
以此为例: dataStore = ["CF$43292419760722083X_431126290063872$蒋先辉$431126290063872$宁远县交管大队$2020-12-04$2021-12-03","CF$431121199009193435_431124290049852$杨鹏杰$431124290049852$道县交警大队$2020-12-04$2021-12-03","CF$432926197112084437_431129290035435$陈亮标$4311292900..
2020-12-10 14:55:20
497
原创 13位时间戳转换为时间格式 excel表格读取时间戳转换为时间格式
13位时间戳转换为时间格式import timetimeArray = 1542297599000timeArray = time.localtime(int(str(timeArray)[:10:]))otherStyleTime = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)print(otherStyleTime)运行结果:excel表格读取时间戳并转换为时间格式from xlrd import xldate_as...
2020-07-21 17:53:15
1781
原创 python存储json 读取json
存储json文件,逐条按行存储 with open('xxx.json', 'a+', encoding='utf8')as f: json.dump(temp, f, ensure_ascii=False) f.write('\n')读取json文件,逐条按行读取with open('xxx.json', 'r', encoding='ut...
2019-08-02 17:13:23
334
原创 企业信用代码正则筛选
re.findall(r'[1-9A-Z]{1}[1239]{1}[1-9]{1}[0-9]{5}[0-9A-Z]{10}', F_ShehuiXinYongCode)[0] if len(re.findall(r'[1-9A-GY]{1}[1239]{1}[1-9]{1}[0-9]{5}[0-9A-Z]{10}', F_ShehuiXinYongCode)) > 0 else ''...
2019-05-17 15:39:18
884
原创 python json和csv文件存储
存储json文件,逐条按行存储 with open('xxx.json', 'a+', encoding='utf8')as f: json.dump(temp, f, ensure_ascii=False) f.write('\n')存储csv文件 with codecs.open(file_name, 'a+', encoding...
2019-05-16 18:04:07
266
转载 python 取整法(进一取值)
import matha = 3 / 2print(a,type(a))a = math.ceil(a)print(a,type(a))输出结果:
2019-05-16 16:30:16
15761
转载 python 科学计数法
import numpy as npa = '111111111111111111111111111111111111111'np.set_printoptions(suppress=True)x = np.array(a)b = float(a)print(a)print(x,type(x))print(b,type(b))输出结果:
2019-05-16 16:10:53
19402
原创 python创建文件夹,有则pass,无则创建
file_name = '文件路径/文件名称"print(file_name)download_path = os.path.split(file_name)[0]if os.path.isdir(download_path): passelse: os.mkdir(download_path)
2019-05-16 10:42:18
516
原创 无头浏览器
options = webdriver.ChromeOptions()options.set_headless()driver = webdriver.Chrome(chrome_options=options)
2018-12-13 16:35:59
742
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人