Skip to content

Instantly share code, notes, and snippets.

@reidrac
Created July 28, 2010 15:24
Show Gist options
  • Save reidrac/494879 to your computer and use it in GitHub Desktop.
Save reidrac/494879 to your computer and use it in GitHub Desktop.
args = {
'db': connect['database'],
'user': connect['username'],
'passwd': connect['password'],
}
if 'hostname' in connect:
# hostname implies port (although it can be default)
args['host'] = connect['hostname']
args['port'] = connect['port']
self._db = MySQLdb.connect(**args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment