代码没有找到记事本文件,请帮忙
SEND_REPORT_TUPLE = ('wet', 'water', 'liquid')
#make a list from the input
input_list = answer.split(" ")
#And then the use any function with comprehension list
if any(e in SEND_REPORT_TUPLE for e in input_list):
file = open('Notepad', 'r')
print = file
答案 0 :(得分:1)
确保您的文件与python脚本位于同一目录中,或者为其提供完整路径。您还应该将文件扩展名放在名称
中即
file = open('Notepad.txt','r')