Cecil Westerhof <ce...@decebal.nl> wrote: >In Java you (can) use a properties file store configuration. What is >the best way to do something like that in Python? >I saw ConfigParser, but have the feeling that it is not really used. >Would a JSON file be a good idea?
If you only want to read the configuration, just use an ordinary file you import. For example config.py contains the lines: username=myuser server=myserver password=secret In your script: import config Now you can referenc all the variables via config.<name>, e.g. config.username Another method would be a dictionary for your config. You could pickle and unpickle it. -- Dipl.-Inform(FH) Peter Heitzer, peter.heit...@rz.uni-regensburg.de -- https://mail.python.org/mailman/listinfo/python-list