I'm trying to make a Python script that lets me choose what function to do (for example, clean the downloads folder or download videos). All of these cases have a separate script which I import into the main .py file. The way I currently have it set up, I get the input and then if it's 1 then execute the first function, if it's 2 execute the second function and so on. Here's my code currently:
if action == 1:
instagram_downloader()
print("Done")
elif action == 2:
clean_downloads()
print("Done")
While this isn't too bad for a small amount of functions, once I get into double digits it will get messy and inefficient. Is there a better and more efficient way to do this?