I use config module to store variables global to all modules. Is it a good place to parse the script arguments? (Note: config module is my own module, it just contains a bunch of global variables.)
----- config.py -----
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-t", "--test", action = "store_true", dest = "test")
#add other options here
(options, args) = parser.parse_args()
------ file1.py ------
import config.py
if config.options.test:
#do something
------ file2.py ------
import config.py
if config.options.test:
#do something
I am concerned about executing the parse_args()
function in a file other than the "main" file (invoked from the command line).