读取不存在的文件alice.txt
#!/usr/bin/env python
-*- coding: utf-8 -*-
filename='alice.txt'
try:
with open(filename) as file_object:
contents=file_object.read()
except FileNotFoundError:
message="Sorry,the file "+filename+" does not exist."
print(message)
请问各位大神这是什么情况~