heres the starting code of the gui.
from tkinter import *
from PIL import ImageTk, Image # type "Pip install pillow" in your terminal to install ImageTk and Image module
import sqlite3
from tkinter import messagebox, Tk
window = Tk()
window.rowconfigure(0, weight=1)
window.columnconfigure(0, weight=1)
window.state('zoomed')
window.resizable(0, 0)
window.title('Login and Registration Page')
# Window Icon Photo
icon = PhotoImage(file='images\\pic-icon.png')
window.iconphoto(True, icon)
LoginPage = Frame(window)
RegistrationPage = Frame(window)
for frame in (LoginPage, RegistrationPage):
frame.grid(row=0, column=0, sticky='nsew')
def show_frame(frame):
frame.tkraise()
show_frame(LoginPage)
how can i make this page into different file by using class so that the code wont be any long and clean. i cant post the whole code since it said it will be all code so i just need help with this one need to make this a object oriented code
# ==================== LOGIN PAGE =====================================================================================
design_frame1 = Listbox(LoginPage, bg='#0c71b9', width=250, height=100, highlightthickness=0, borderwidth=0)
design_frame1.place(x=0, y=0)
# ====== Email ====================
email_entry = Entry(design_frame4, fg="#a7a7a7", font=("yu gothic ui semibold", 12), highlightthickness=2,
textvariable=Email)
# function for show and hide password
def password_command():
if password_entry1.cget('show') == '•':
password_entry1.config(show='')
else:
password_entry1.config(show='•')
source https://stackoverflow.com/questions/74423937/how-to-divide-this-into-class-and-object-loginform-py-and-registrationform-py
Comments
Post a Comment