import json
from configparser import ConfigParser
# test.json
'''
[{"name": "apple", "price": "10", "amount": "3"},
{"name": "tesla", "price": "100000", "amount": "1"},
{"name": "mac", "price": "3000", "amount": "2"},
{"name": "lenovo", "price": "30000", "amount": "3"},
{"name": "chicken", "price": "10", "amount": "3"}]
'''
# mysql.ini
'''
[DEFAULT]
a = test
[mysql]
default-character-set = utf8
[mysqld]
test1 = 200
datadir = /dbserver/data
port = 33060
character-set-server = utf8
sql_mode = NO_ENGINE_SUBSTRITUTION,STRICT_TRANS_TABLES
c = True
[test]
test1 = 100
'''
# sun.csv
'''
name,price,amount
apple
python实现json、ini、csv格式的文件转换
最新推荐文章于 2024-01-07 23:53:14 发布