import mysql.connector as hostdb def getDB(): mydb = hostdb.connect( host='', user='', password='', database='' ) return mydb