Reputation: 679
My python module needs to save some configuration files into a disk, is there a standard convention on where to save your module configuration files? one that you won't run into a permission error.
Upvotes: 0
Views: 398
Reputation: 2930
You can store these configuration file where ever you want (as long as your python script have the write permission to this directory and no process prevent it from writing to this directory (is not locked by other process)), as long as your module can reach them for parsing or for import if they are a python files.
what are the options:
os.path
with os.chdir(path)
to this dir for parsing.dir_x
and provide the dir_x path
to your python script via command line args with sys.argv[1]
. or with argparse!Upvotes: 2