2019年10月11日 星期五

[Python] I/O

2.7

import glob,os
from os.path import isfile, join
from os import walk
import urllib

* Read

with open(filePath, 'r') as file:
            data = file.read()
            decodeData = urllib.unquote(data)
           
* Write

f1=open(newFilePath, 'w+')
f1.write(decodeData)
f1.close()

沒有留言:

張貼留言