learn py by my own 20th day

# -*- coding: utf-8 -*-
"""
Spyder Editor


This is a temporary script file.
"""
import os

os.chdir('C:\\Users\\joyce\\test_demo_py')
fo = open('data.txt','w') #truncate 覆盖
fo.writelines(['1 2 3 4\n','2 3 4 5\n'])

fo.close()




图片截取自http://www.runoob.com/python3/python3-inputoutput.html



阅读更多
版权声明:open source https://blog.csdn.net/Smith_My_/article/details/79956682
个人分类: 大数据
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭