Mysql Connectivity Program In Python Using Loop