Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. #import modules
  2. from tkinter import *
  3. import random
  4. from tkinter import messagebox
  5. import importlib
  6. # creating the object
  7. root = Tk()
  8.  
  9. # resolution of the window
  10. root.geometry("500x540+500+100")
  11. root.title ("ABC HOSPITAL")
  12.  
  13. # preventing the resize feature
  14. root.resizable(False, False)
  15. def doc():
  16. importlib.import_module('login')
  17.  
  18. #LABELS=====================================================
  19. heading = Label(font=('times new roman' , 25 , 'bold'), text="WELCOME TO ABC HOSPITAL", fg='black', bg='#fbf9d3')
  20. heading.place(x=3, y=10)
  21.  
  22. heading = Label(font=('times new roman' , 22 , 'bold'), text="Choose Login", fg='black', bg='#fbf9d3')
  23. heading.place(x=150, y=250)
  24. #button to perform a command=======================================================
  25. login = Button(font=('arial' , 20 , 'bold'),bd=14, text="DOCTOR's LOGIN", fg='white',bg='#04062c',width=27,height=2, command=doc)
  26. login.place(x=4,y=300)
  27.  
  28. root.mainloop()
  29.  
  30. #import modules
  31. from tkinter import *
  32. import mysql.connector
  33. from mysql.connector import errorcode
  34. import random
  35. from tkinter import messagebox
  36.  
  37. # creating the object
  38. root = Tk()
  39.  
  40. # resolution of the window
  41. root.geometry("1520x790+0+0")
  42. root.title ("ABC HOSPITAL")
  43. root.iconbitmap('hospital.ico')
  44.  
  45. # preventing the resize feature
  46. root.resizable(False, False)
  47.  
  48. #tkinter window
  49. class Application:
  50.  
  51. #funtion for main frames=====================================================================================================================================================================
  52.  
  53. def __init__(self, master):
  54. self.master = master
  55.  
  56. # creating the frames in the master
  57. self.left = Frame(master, width= 1600, height= 900, bg='lightblue',relief=SUNKEN)
  58. self.left.pack(side=TOP)
  59.  
  60. #Background Picture
  61. self.photo1 = PhotoImage(file='background.png')
  62. self.pic = Label(self.left, font=('arial' , 1 , 'bold'), image= self.photo1)
  63. self.pic.place(x=0, y=0)
  64.  
  65.  
  66. #LABELS=====================================================
  67. self.heading = Label(self.left,font=('arial' , 50 , 'bold'), text="ABC Hospital", fg='black', bg='#06378b' ,anchor='w')
  68. self.heading.place(x=550, y=0)
  69.  
  70. #Login Picture
  71. self.photo = PhotoImage(file= 'login.png')
  72. self.pic = Label(self.left, font=('arial' , 40 , 'bold'), image= self.photo ,fg = "lightblue", bg='#06378b')
  73. self.pic.place(x=640, y=100)
  74.  
  75. # user name
  76. self.username = Label(self.left, text="Username", font=('arial 30 bold'), fg='black', bg='#063998')
  77. self.username.place(x=550, y=350)
  78.  
  79. # password
  80. self.password = Label(self.left, text="Password", font=('arial 30 bold'), fg='black', bg='#063998')
  81. self.password.place(x=550, y=410)
  82.  
  83. #TEXTBOX=====================================================
  84. #username
  85. self.username_ent = Entry(self.left,font=('arial' , 20 , 'bold'))
  86. self.username_ent.place(x=750, y=360)
  87.  
  88. #password
  89. self.password_ent = Entry(self.left, font=('arial' , 20 , 'bold'),show='*')
  90. self.password_ent.place(x=750, y=420)
  91.  
  92. # button to perform a command================================
  93. #button1
  94. self.login = Button(self.left,font=('arial' , 20 , 'bold'), text="LOGIN", bg='steelblue',command=self.login)
  95. self.login.place(x=700, y=480)
  96.  
  97. b = Application(root)
  98. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement