python
文章平均质量分 50
van_peak
这个作者很懒,什么都没留下…
展开
-
python打印所有时区
from datetime import datetimeimport pytzALL_TIMEZONE_CHOICES = tuple(zip(pytz.all_timezones, pytz.all_timezones))COMMON_TIMEZONE_CHOICES = tuple(zip(pytz.common_timezones, pytz.common_timezones))PRETTY_TIMEZONE_CHOICES = []for tz in pytz.common_tim原创 2021-01-11 19:03:09 · 701 阅读 · 1 评论 -
Python遍历列表数据结构的三种方法
response = [{'Name': 'sub', 'Value': 'd7545d1b-bf78-424b-ab06-8b0f5809513a'}, {'Name': 'zoneinfo', 'Value': 'Afghanistan'}, {'Name': 'email_verified', 'Value': 'false'}, {'Name': 'email', 'Value': 'test@test.com'}]for i原创 2020-12-16 19:43:07 · 717 阅读 · 0 评论 -
Python 3.7 重命名文件
Python 3.7 重命名文件import osfor root, dirs, files in os.walk("C:\\Users\\Administrator\\Desktop\\证书\\"): for f in files: srcFile = os.path.join(root, f) dstFile = srcFile.split("_")[0] + os.path.splitext(srcFile)[-1] print(srcFi原创 2020-11-26 14:20:26 · 106 阅读 · 0 评论 -
AWS Lambda pyOpenSSL 层打包方法
亚马逊Lambda pyOpenSSL 层生成方法:pip3 install --target ./pyOpenSSL pyOpenSSLcd pyOpenSSL/zip -r9 ${OLDPWD}/pyOpenSSL.zip .下载pyOpenSSL.zip,解压文件到pyOpenSSL文件夹,重命名为python,重新压缩生成层。原创 2020-11-24 21:10:57 · 168 阅读 · 0 评论 -
python时间戳转UTC时间
import datetimeutc_time = datetime.datetime.utcfromtimestamp(1604473706)stadardTime = utc_time.strftime("%Y-%m-%d %H:%M:%S")print(stadardTime)输出结果:2020-11-04 07:08:26原创 2020-11-04 15:44:52 · 5809 阅读 · 0 评论 -
python 参数经过透传给目标方法
def zhongjian(parma1, parma2, *args, **kwargs): print("zhongjian parma1: ", parma1, "parma2: ", parma2) print("zhongjian args: ", args) print("zhongjian kwargs: ", kwargs) mubiao(parma1, parma2, *args, **kwargs)def mubiao(parma1, parma2,原创 2020-10-29 14:15:39 · 1045 阅读 · 0 评论