How to store variables/preferences in Python for later use
问题 I'm working on a program in Python for Windows, and would like to save variables and user preferences so that I can recall them even after the program has been terminated and restarted. Is there an ideal way to do this on Windows machines? Would _winreg and the Windows registry be suited for this task? Or do I need to create some sort of database of my own? 回答1: You're usually going to want to store it in a configuration folder in the "home" folder. That's easy on *nix systems, more difficult