学习Python编程7,文件
打开读取文件file open(example.txt, r)
data file.read()
print(data)一行一行读取file open(example.txt, r)
for line in file:print(line)错误异常处理try:file open(example.txt, r)
except FileNotFoundError:print("File not found!")模式r,读…
2026/7/18 15:46:27