file_path = '第十章\\练习10-1\\learning_python.txt'
with open(file_path) as file_object:
for line in file_object:
print(line.strip())
with open('learning_python.txt') as file_object1:
for line in file_object1:
print(line.strip())
‘learning_python.txt’在此文件的相同目录里,第二种打开文件方式为什么不行。