this program quits after printing the first line and seemingly doesn't enter the while loop. i'm at a dead end here, any help would be appreciated. it's design is to create files with the same name at different directories
print ("What is the name of the command to create?: ")
#loops until program is done
exit = "placeholder"
while exit != exit:
#filename to use for directory creation
cmd = input()
#combines cmd name with directory
cmdDir = "/usr/bin/" + cmd
#makes sure something was entered as a cmd name
if cmdDir == "/usr/bin/":
print ("Command name invalid. Try again: ")
else:
#creates file at directory with cmd name
open (cmdDir, 'a')
print ("Will this command have a python extension?: ")
#loops until program is done
while exit != exit:
decision = input()
#combines cmd name with python directory
pythonDir = "/root/python/" + cmd + ".py"
if decision == "yes":
#creates directory
open (pythonDir, 'a')
print ("Command directories " + cmdDir + " and" + pythonDir + " created. ")
#sets program to exit while loops
exit = "exit"
elif decision == "no":
print ("Command directory " + cmdDir + "created. ")
#sets program to exit while loops
exit = "exit"
else:
print ("Enter yes or no: ")
ps: formatting this manually with the 4-space indent was a pain in the ass, how does the auto-indent work?
while exit != exit:; What do you think this is doing?