用python怎么创建一个文件

2024-07-10 02:41:13
推荐回答(1个)
回答1:

with open('test.txt','w') as f:
    f.write('hello 搭早world') #创歼历建文件test.txt并氏枝搜写入hello world