1、读
1 f = read('$filePath', 'r') 2 line = f.readline() #读取一行 3 lines = f.readlines() #读取所有行
2、写
1 with open('$filePath', 'w') as fw: 2 fw.write(sth)
1、读
1 f = read('$filePath', 'r') 2 line = f.readline() #读取一行 3 lines = f.readlines() #读取所有行
2、写
1 with open('$filePath', 'w') as fw: 2 fw.write(sth)