`open`
Character Meaning 'r' open for reading (default) 'w' open for writing, truncating the file first 'x' create a new file and open it for writing 'a' open for writing, appending to the end of the file if it exists 'b' binary mode 't' text mode (default) '+' open a disk file for updating (reading and writing) 'U' universal newline mode (deprecated)
open 接受Unix-style风格和典型的windows风格的斜杆。
open(r'C:\sss\sss.py')
open('C:/xx/xx.py')
open('C:\\xx\\xx.py')
open的写入方式都是Strings,若需要存储Native Python Objects, 使用Pickle module
pickle.dump(data,file) data=pickle.load(file)