Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import gtk.glade
- import gtk
- import gnome.ui
- from base64 import *
- APPNAME="Login Gui"
- APPVERSION="0.1"
- class LoginGTK:
- """This is an Hello World GTK application"""
- def __init__(self):
- gnome.init(APPNAME, APPVERSION)
- #Set the Glade file
- self.gladefile = "login.glade"
- self.wTree = gtk.glade.XML(self.gladefile)
- self.wTree.get_widget("entry1")
- self.wTree.get_widget("entry2")
- #Create our dictionay and connect it
- dic = { "on_button1_clicked" : self.on_button1_clicked,
- "on_MainWindow_destroy" : gtk.main_quit }
- self.wTree.signal_autoconnect(dic)
- def on_button1_clicked(self, widget):
- User = "RGFya215c3RlcmU="
- Username = entry1.get_text()
- result1 = b64encode(Username)
- if result1 == User:
- print "Correct Username"
- Pass = "TWFzdGVy"
- Password = entry2.get_text()
- result2 = b64encode(Password)
- if result2 == Pass:
- print "Correct Password"
- if __name__ == "__main__":
- hwg = LoginGTK()
- gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement