ConfigParser is the much debated vanilla configuration parser for Python. However you can simply import config where config.py has python code whic
import config
config.py
This completley depends on your needs and goals for the script. One way really isnt "better", just different. For a very detailed discussion on most of pythons config parsers (including ConfigParser and config modules), see:
ConfigParser
config
Python Wiki - ConfigParserShootout