ython 分隔,替换字附串,长整数秒转时间 # -*- coding: utf-8 -*- dd='食品大类,报告分类,创建日期,报送分类,原产国,许可证类型,许可证号,' dz=dd.split(',') print(len(dz)) print(dz) a=' dsf 中国(人民) ' print(a.replace(' ', '').replace('(', '(').replace(')', ')')) print(a.strip()) # for i in range(7): # print(chr(123+i)) import time rstr='1614960000000' def rqzh(rqstr): tempt = time.localtime(float(rqstr[:-3])) # 秒数1615024126000 错了一千位,毫秒 # 1615024126000 return time.strftime("%Y-%m-%d %H:%M:%S", tempt) print(rqzh(rstr)) import time import datetime timeStamp = 1559567943 aa = datetime.datetime.utcfromtimestamp(timeStamp) otherStyleTime = time.strftime("%Y-%m-%d %H:%M:%S", aa) print(otherStyleTime) s=1615024126000 # print(s/1000) # print('one',scdw) # def gezd(scdw): # print(scdw) # print(scdw['name']) # # z=gezd(scdw) x='a2b45' wz=x.find('b') print(wz) a=int(x[1:wz]) b=int(x[wz+1:]) print('a'+str(a+b)+'b0') if ('a','in',['a','ab']): print('pk')
ython 分隔,替换字附串,长整数秒转时间p
最新推荐文章于 2022-03-17 18:15:20 发布