会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
ppxs
博客园
首页
新随笔
联系
管理
订阅
2022年9月20日
Python中使用pyyaml对yaml文件进行读写删操作
摘要: 安装库 pip install pyyaml 读取yaml/yam格式的文件 def get_yaml(filepath) -> list: """ :param filepath: 文件路径 :return: 传入数据的列表 """ data = open(filepath, 'r', encod
阅读全文
posted @ 2022-09-20 10:41 金色弗兰奇
阅读(329)
评论(0)
推荐(0)
2022年9月19日
Python在字典中通过键名查找键值
摘要: def find(target, dict_data): """ :param target: 需要查找的键名 :param dict_data: 需要查找的列表 :return: 如果找到就返回对应键名的键值,否则提示没有找到 """ result = [dict_data] while len(
阅读全文
posted @ 2022-09-19 18:26 金色弗兰奇
阅读(189)
评论(0)
推荐(0)
2022年9月16日
Python获取当前时间戳
摘要: import time def now_to_timestamp(digits=10): time_stamp = time.time() digits = 10 ** (digits - 10) time_stamp = int(round(time_stamp * digits)) return
阅读全文
posted @ 2022-09-16 11:38 金色弗兰奇
阅读(209)
评论(0)
推荐(0)