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的使用

 

posted @   simadi  阅读(40)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
历史上的今天:
2021-09-28 c#雷达扫描动画
2020-09-28 思科、华为交换机OID获取
2016-09-28 微信小程序开发者工具集合包
点击右上角即可分享
微信分享提示