嗨,我正在开发一个程序,将一些文件存储到文本文档中,必要时可以重新加载。下面是代码的开头,但是当我认为我已将其定义为文本文件的名称时,我收到一条回溯错误,指出“recipe_title 未定义”。请帮我看看我做错了什么。
import sys
opt=0
def choice1():
print("WORKED")
def choice2():
Recipe_Name = input("Please enter a recipe name: ")
Recipe_List = open(recipe_title.txt,"w")
Recipe_List.write(recipe_title+"\n")
def ingredient_input_loop(recipe_title, ):
Recipefile = open(recipe_title,"w")
if(ingredient== "end" or "End" or "END" or "EnD" or "eNd" or "enD" or "ENd" or "eND"):
Recipe.write(recipe_title)