I have the following MySQL connection:
import MySQLdb as mdb
rbpdb = mdb.connect(host='db01.myhost.co.nl,
user='pdbois',
passwd='triplex',
db='myxxx')
In the course of coding, I will re-use this connection many times in many function. Both for reading, creating and updating the DB.
What's the best way to implement that without having to call the above snippets many times? Can we put it in separate file as class or functions? If so how can we call it?