python:文件读写

#!/usr/bin/python
# -*- coding:utf-8 -*-

#!/usr/bin/python
# -*- coding:utf-8 -*-

file1 = open('a.txt','r')
str = file1.read()
file2 = open('b.txt','w')
file2.write(str)

posted @ 2019-10-15 15:58  流星曳尾  阅读(85)  评论(0编辑  收藏  举报