[HowTo] use configuration/parameter/option files

Created by RaiMan on on 2012-07-26
Keywords:

In cases, where it is not possible or does not make sense to give parameters and options to a Sikuli script via command line, there is a really convenient feature in Jython: ConfigParser

usage from https://answers.launchpad.net/sikuli/+question/204153 (thanks to pyCoder)

http://www.jython.org/docs/library/configparser.html

#inside script
import ConfigParser

config = ConfigParser.ConfigParser()
config.read('config.ini')
username = config.get('settings','username')
ipAddress = config.get('settings','ipAddress')

# setup your 'config.ini'

[settings]
username = Bob Marley
ipAddress = 190.943.1

You might use any filenames you want