Advertisement
Guest User

Untitled

a guest
Apr 19th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. import imaplib # import the imap library
  2. from tkinter import * #import everything from the tkinter library (for use with gui)
  3.  
  4.  
  5. global user
  6. global pword
  7. global root
  8.  
  9. def LoginClick():
  10. mail = imaplib.IMAP4_SSL('elwood.yorkdc.net')
  11. mail.login(user, pword)
  12. LoginClick.mainloop()
  13.  
  14. root = Tk() #creates new window
  15. root.title('Login') #sets title of window
  16. root.configure(background='black') #change background colour of window
  17.  
  18. instruction = Label(root, text='Please Loginn') #Creates label
  19. instruction.configure(background='black', fg='white') #Configuring label style
  20. instruction.grid(sticky=E) #Sticks to eastern edge
  21.  
  22. userL = Label(root, text='Username: ')
  23. userL.configure(background='black', fg='white')
  24. pwordL = Label(root, text='Password: ')
  25. pwordL.configure(background='black',fg='white')
  26. userL.grid(row=1, sticky=W)
  27. pwordL.grid(row=2, sticky=W)
  28.  
  29. user = Entry(root)
  30. pword = Entry(root, show='*')
  31. user.grid(row=1, column=1)
  32. pword.grid(row=2, column=1)
  33.  
  34. loginB = Button(root, text='Login', command=LoginClick)
  35. loginB.grid(columnspan=2, rowspan=2, sticky=W)
  36. root.mainloop()
  37.  
  38. Exception in Tkinter callback
  39. Traceback (most recent call last):
  40. File "C:UsersMarcusAppDataLocalProgramsPythonPython36-32libtkinter__init__.py", line 1699, in __call__
  41. return self.func(*args)
  42. File "C:UsersMarcusDesktopNetworkingIMAP.py", line 11, in LoginClick
  43. mail.login(user, pword)
  44. File "C:UsersMarcusAppDataLocalProgramsPythonPython36-32libimaplib.py", line 588, in login
  45. typ, dat = self._simple_command('LOGIN', user, self._quote(password))
  46. File "C:UsersMarcusAppDataLocalProgramsPythonPython36-32libimaplib.py", line 1180, in _quote
  47. arg = arg.replace('\', '\\')
  48. AttributeError: 'Entry' object has no attribute 'replace'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement