My config file is really just a big python dict, but I have many config files to run different experiments and I want to ‘import’ a different one based on a command line option. Instinctively I want to do import ConfigFileName where ConfigFileName is a string with the config file’s python package name in it… but that doesn’t work.
Any ideas?
Use the
__import__builtin function. But like nosklo, I prefer to store it in simpler data format like JSON of INI config file.