当前位置:网站首页>Write data to local file
Write data to local file
2022-06-26 10:24:00 【Boundless universe PY】
def test():
a = [
{“yoyo1”: “123456”},
{“yoyo2”: “123456”},
{“yoyo3”: “123456”},
]
# Open a file named test.txt The file of , If the file doesn't exist , Automatically create
with open('test.txt', 'w') as f:
for i in a:
# Dictionary in circular array
for key, value in i.items():
# Store data txt In file
f.write("{0},{1}\n".format(key, value))
print("{0},{1}\n".format(key, value))
test()
边栏推荐
猜你喜欢

Call API interface to generate QR code of wechat applet with different colors

MySQL第十二次作业-存储过程的应用

Develop current learning objectives and methods

3行3列整形二维数组,求对角之和

118. Yanghui triangle

Detailed explanation of winsorflow quantum installation process

國際化配置

P1296 whispers of cows (quick row + binary search)

微软 Edge 浏览器 IE 模式标签页出现卡死情况,已通过回滚更新修复

The first batch of 12 enterprises settled in! Opening of the first time-honored product counter in Guangzhou
随机推荐
Global and Chinese market of recycled paper 2022-2028: Research Report on technology, participants, trends, market size and share
创建对象的时候堆内存的分配
Retrofit common request methods and comments, post, get heard file upload
MySQL 13th job - transaction management
About multi table query of MySQL
JSP file syntax
Record the handling of oom problems caused by too many threads at one time
Testing practice - App testing considerations
瑞萨电子面向物联网应用推出完整的智能传感器解决方案
Software testing - how to select the appropriate orthogonal table
Automated testing -- Introduction and example of pytest framework
904. 水果成篮
MySQL第六章总结
MySQL第五章总结
Crawler related articles collection: pyppeter, burpsuite
MySQL project 7 Summary
Little red book - Summary of internal sales spike project
Openxcap usage
Hcia-dhcp experiment
Redis master-slave replication in win10 system