0%

本地数据如何获取?用Python获取本地数据

打开后才能进行读写

文件的打开

1
2
3
>>>f1=open('d:\\infile.txt)
>>>f2=open(r'd:\outfile.txt','w')
>>>f3=open('record,dat,'wb','0)

file_obj=open(filename,mode=’r’,buffering=-1,…)

  • mode为可选参数,默认值为r
  • buffering也为可选参数,默认值为-1(0代表不缓冲,1或者大雨1的值表示缓冲一行或指定缓冲区大小)

    open()函数-mode


| | | | |

| | | | | |