db close(database script to populate and query mysql database from mysqldb import connect conn connect(host='localhost'user='root'passwd='xxxxxxx'curs conn cursor(trycurs execute('drop database testpeopledb'exceptpass did not exist curs execute('create database testpeopledb'curs execute('use testpeopledb'curs execute('create table people (name char( )job char( )pay int( ))'curs execute('insert people values (% % % )'('bob''dev' )curs execute('insert people values (% % % )'('sue''dev' )curs execute('insert people values (% % % )'('ann''mgr' )curs execute('select from people'for row in curs fetchall()print(rowcurs execute('select from people where name % '('bob',)print(curs descriptioncolnames [desc[ for desc in curs descriptionwhile trueprint('- row curs fetchone(if not rowbreak for (namevaluein zip(colnamesrow)print('% =% (namevalue)conn commit(save inserted records fetch and open/play file by ftp import webbrowsersys from ftplib import ftp socket-based ftp tools from getpass import getpass hidden password input if sys version[ =' 'input raw_input compatibility nonpassive false filename input('file?'dirname input('dir'or sitename input('site?'user input('user?'if not useruserinofo (elsefrom getpass import getpass force active mode ftp for serverfile to be downloaded remote directory to fetch from ftp site to contact use (for anonymous hidden password input part viiexceptions and tools