迷人灰狼

文章
4
资源
0
加入时间
3年1月10天

python统计词频瓦尔登湖_1.5 python文件操作

1.5.1 文件的具体操作打开文件f = open('test.txt', 'w')在python,使用open函数,可以打开一个已经存在的文件,或者创建一个新文件:open(文件名,访问模式)写数据(write)f = open('test.txt', 'w')f.write('hello world,\n')f.write('i am here!\n')f.close()结果hello wor...