open()read()readline()seek()write()close() # 默认只读file = open('name.txt', 'w')file.write('abc')file.close()file2 = open('name.txt')data = file2.read()print(data)file2.close()file3 = open('name.txt', 'a')file3.write('def')file3.close()