Ну, через некоторое время и некоторой помощи, я наконец-то смог сделать то, что хотел, мы создали рекурсивную функцию (не уверен, что это она называется tho), а затем вызвали ее позже с помощью функции add: ....
def getstore(fm_list):
store = input("Where do you want to store your subfolder?: "
"\n Insert A to store it in the DEFAULT folder"
"\n Insert B to store it in a new folder\n")
if store.lower() == "a":
subfolder = input("What is the name of the subfolder: ")
fm_list.append(subfolder)
print("Your subfolder will be store to the Default folder: ")
os.chdir('F:\\Test\\Default') # this is the Default folder already in the test directory
os.makedirs(subfolder, exist_ok=True)
print(subfolder + " was added to the folder named Default")
quit()
elif store.lower() == "b":
folder = input("Name of the folder: ")
fm_list.append(folder)
os.chdir('F:\\Test')
os.makedirs(folder, exist_ok=True)
subfolder = input("Name of the subfolder: ")
fm_list.append(subfolder)
os.chdir('F:\\Test\\' + folder)
os.makedirs(subfolder, exist_ok=True)
print(folder + " was added to the list of folder.")
print(subfolder + " was added to " + folder)
quit()
else:
getstore(fm_list)
потом, когда мы доберемся до elif msg == "2"
, мы называем getstore(fm_list)
просто так ...
elif msg == "2":
getstore(fm_list)
break
else:
print("Invalid entry!!!\n")
continue
И все.