Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def init__database(self, command, user, password, host, port):
- if command == 'CONNECT':
- self.db = MySQLdb.connect(host, port=port, user=user, passwd=password)
- elif command == 'DISCONNECT':
- # buat fungsi untuk reset form `user, password, host, & port` ke default.
- return self.db.close()
- def oke(self, Event=None):
- self.user=self.E_user.get()
- self.password=self.E_passw.get()
- try:
- # disini self.db.cursor() sudah bisa dipake.
- #self.db = MySQLdb.connect("localhost",port=3306, user=self.user, passwd=self.password)#, db="perbankan" )
- self.cursor = self.db.cursor()
- self.showdata.configure(state=NORMAL)
- print 'sukses'
- except MySQLdb.OperationalError:
- ....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement