1 >>> file=open('c://333.csv','r') 一些基本打开关闭操作 2 >>> s=file.read() 3 >>> print s 4 ,add,age,name 5 0,beijing,12,zhang 6 1,shanghai,24,li 7 2,tainjing,25,wang 8 >>> file.close()
1 >>> file=open('c://333.csv','r') 2 >>> file2=open('c://111.csv','w') 将333内容写到111中 3 >>> file2.write(file.read()) 4 >>> file2.close() 5 >>> file.close() 6 >>> file2=open('c://111.csv') 7 >>> file2=open('c://111.csv','r') 8 >>> s=file2.read() 9 >>> print s 10 ,add,age,name 11 0,beijing,12,zhang 12 1,shanghai,24,li 13 2,tainjing,25,wang