pyside 学习目标
官方文档 https://doc.qt.io/qtforpython/examples/index.html
1 获取配置信息
2022-9-28
新建项目
新建 config.yaml 文件内容如下
mysql:
host: "127.0.0.1"
port: 3306
user: "root"
password: "123456"
database: "test"
main.py代码
import yaml # pip3 install pyyaml
import os
def print_hi(name):
# 在下面的代码行中使用断点来调试脚本。
print(f'Hi, {name}') # 按 Ctrl+F8 切换断点。
# 按间距中的绿色按钮以运行脚本。
if __name__ == '__main__':
print_hi('PyCharm')
with open(os.path.expanduser("config.yaml"), "r") as config:
cfg = yaml.safe_load(config)
print(cfg.get('mysql').get('host'))#读
with open(os.path.expanduser("config.yaml"), "w") as config0:
cases = {"f": {"name": "leaf", "age": 19}}
yaml.dump(cases, config0, allow_unicode=True)#写
2 写日志
3 数据库读写
4 mitmProxy的使用
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
2021-09-28 c#雷达扫描动画
2020-09-28 思科、华为交换机OID获取
2016-09-28 微信小程序开发者工具集合包