So I have a text file that should be used as user input throughout my entire Python script. Let's say that my text file looks like this:
input1
input2
input3
input4
And then I have a while loop that looks like this:
mainFlag = True
while mainFlag == True:
userInput = input("Choose one of the 4 inputs")
if userInput == 'input1':
function1()
elif userInput == 'input2':
function2()
elif userInput == 'input3':
function3()
elif userInput == 'input4':
function4()
How can I loop through the input text file, take each line as a string and use that string as user input for inside the while loop?
Thanks