I have a script that asks the user for the path to their desired directory
default_path = '/path/to/desired/directory/'
user_path = raw_input("Enter new directory [{0}]: ".format(default_path)) or default_path
print user_path
The script has a "default" directory if no input is given. I want the script to "remember" the directory entered by the user. That is, the next time the script is run I want the default path to be the path input by the last user. Is this possible?
Maybe more generally, is there a good reference for writing command-line tools in python?