Advertisement
Guest User

Untitled

a guest
Jul 12th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. [........
  2. user = input('Enter Your UserName:')
  3. pass = input('Enter Your Password:')
  4. ........]
  5.  
  6. Warning (from warnings module):
  7. return fallback_getpass(prompt, stream)
  8. GetPassWarning: Can not control echo on the terminal.
  9. Warning: Password input may be echoed.
  10.  
  11. import sys
  12. shell = sys.stdout.shell
  13. shell.show input as '0';
  14. ....
  15.  
  16. import sys
  17. import os
  18. import getpass
  19.  
  20. sys.stdout = os.devnull
  21. getpass.getpass()
  22.  
  23. == RESTART: Shell ==
  24.  
  25. # import tkinter (a crossplatform GUI)
  26. import tkinter
  27.  
  28. # import a simple dialog form with a label and a button
  29. # so you don't have to build one yourself
  30. import tkinter.simpledialog
  31.  
  32. # create an empty main window for GUI,
  33. # without it you will get an error:
  34. # AttributeError: 'NoneType' object has no attribute 'winfo_viewable'
  35. tk_root = tkinter.Tk()
  36.  
  37. # you don't really need to show it, so hide it immediately
  38. tk_root.withdraw()
  39.  
  40. # create a dialog window with title 'Password'
  41. # and a text label 'Enter Your Password:'
  42. # also hide typed password with *
  43. passwd = tkinter.simpledialog.askstring('Password','Enter Your Password:', show='*')
  44.  
  45. def get_pass():
  46. import tkinter
  47. import tkinter.simpledialog
  48. tk_root = tkinter.Tk()
  49. tk_root.withdraw()
  50. return tkinter.simpledialog.askstring('Password','Enter Your Password:', show='*')
  51.  
  52. from tkinter import * #(tkinter (A cross-platform GUI)
  53.  
  54. top = Tk()
  55. def callback(): #what to do after button(Submit) pressed
  56. print(E2.get()) #printing first input
  57. print(E1.get()) #printing second input
  58. top.destroy() #exiting tkinter
  59. top.title('Login')
  60. L1 = Label(top, text="User Name")
  61. L1.grid(row=0, column=0) #setting up position for user name field
  62. E2 = Entry(top, bd = 5)
  63. E2.grid(row=0, column=1)
  64.  
  65. L1 = Label(top, text="Password") # text for second name,currently Password
  66. L1.grid(row=1, column=0) #setting up position for password field
  67. E1 = Entry(top, bd = 5,show='*') #hidding the text with *
  68. E1.grid(row=1, column=1)
  69. MyButton1 = Button(top, text="Submit", width=10, command=callback) # button named submit
  70. # 'command=callback ' the command you want to do|we have created a function callback
  71.  
  72. MyButton1.grid(row=3, column=1) # position for button
  73.  
  74. top.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement