Skip to content

Instantly share code, notes, and snippets.

@tiomoreno
Created February 25, 2013 15:35
Show Gist options
  • Save tiomoreno/5030648 to your computer and use it in GitHub Desktop.
Save tiomoreno/5030648 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
import MySQLdb as Mysql
class MysqlFactory():
"""factory de conexão com mysql"""
def getConnection(self, config):
connection = Mysql.connect(config["host"],config["user"],config["password"])
connection.select_db(config["db"])
return connection;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment