i have wrote the database code like this
import _mysql_exceptions as DB_EXC
cxn = MySQLdb.connect(host='10.0.2.2')
if(cxn != 0):
tkMessageBox.showinfo("Text", "you can update ur local database to server")
tkMessageBox.showinfo("Text", "there is no connection please try again")
except ImportError , e:
when there is connectivity then the control is going to the IF block. but when the connectivity loss the control is not going to the else block. is there any wrong in my syntax.
pls give a quick and valuable reply.