I'm new to python and was hoping if someone could help me with this problem.
Here's The code:
uninput1=input('> ')
while True:
if 'existing' in uninput1 or 'existing file' in uninput1:
print ('Please enter the directory of your file.')
dirfile=input('> ')
print (space)
time.sleep(1)
print ('Now enter the name of your file.')
nmfile=input('> ')
print (space)
time.sleep(1)
txtmod.existing(dirfile, nmfile)
elif 'new' in uninput1 or 'create' in uninput1:
print ('Please enter the directory where you want to create your file.')
dirfile=input('> ')
print (space)
time.sleep(1)
print ('Now enter the name you want to give to your file.')
nmfile=input('> ')
print (space)
time.sleep(1)
txtmod.newfile(dirfile, nmfile)
else:
print ('Error! Please Try again')
What i'm trying to do is to return an error when the user types a certain thing and restart the loop.But what happens is that instead of restarting the loop it just displays my 'error' forever. Can anyone help?
I don't know if this makes sense or not but i hope it does to someone.