绝对路径
f = open('d:345.txt',mode='r',encoding='utf-8') i = f.read() print(f) f.close()
相对路径
f = open('345',mode='r',encoding='utf-8') i = f.read() print(f) f.close()
f = open('d:345.txt',mode='r',encoding='utf-8') i = f.read() print(f) f.close()
f = open('345',mode='r',encoding='utf-8') i = f.read() print(f) f.close()