Create a modern Sign Up form with Python

Create a modern Sign Up form with Python

Looking to design a Sign-Up page with Python and you are tired of Tkinter's old-looking UI? Same! So I was searching for a Tkinter-like GUI builder library. I searched for days and I finally got my answer. Customtkinter!

Customtkinter is just like Tkinter. The code is extremely similar to that of Tkinter's, but with some modern refinements such as native dark mode, rounded windows, rounded buttons, rounded entry boxes etc. All the elements are optimised for dark mode too. So, I decided to build a "Sign Up" form UI using Customtkinter. To install customtkinter, open your terminal and type:

pip install customtkinter

It should get installed within a couple of seconds. Now without wasting any time, let's jump right into the code. You can also find the source code in my Github.

from customtkinter import *
from tkinter import messagebox

r = CTk()
r.geometry("800x600")

CTkLabel(r, text="SIGN UP", text_font=("Zona Pro", 18)).pack(ipady=15)

CTkLabel(r, text="Email:", text_font=("Zona Pro", 12)).place(x=15, y=70)
CTkEntry(r, text_font="Zona", width=450).place(x=200, y=70)

CTkLabel(r, text="Username:", text_font=("Zona Pro", 12)).place(x=15, y=140)
CTkEntry(r, text_font="Zona", width=450).place(x=200, y=140)

CTkLabel(r, text="Mobile:", text_font=("Zona Pro", 12)).place(x=15, y=210)
CTkEntry(r, text_font="Zona", width=450).place(x=200, y=210)

CTkLabel(r, text="Password:", text_font=("Zona Pro", 12)).place(x=15, y=280)
CTkEntry(r, text_font="Zona", width=450).place(x=200, y=280)

CTkLabel(r, text="Confirm Password:", text_font=("Zona Pro", 12)).place(x=15, y=350)
CTkEntry(r, text_font="Zona", width=450).place(x=200, y=350)

def get():
    messagebox.showinfo(title="success!", message="User successfully registered.")

CTkLabel(r, text="Gender:", text_font=("Zona Pro", 12)).place(x=15, y=420)
CTkCheckBox(r, text="Male", text_font="Zona").place(x=240, y=420)
CTkCheckBox(r, text="Female", text_font="Zona").place(x=420, y=420)

CTkButton(r, text="Sign Up", text_font="Zona", command=get).place(x=330, y=510)


r.mainloop()

The final result should look something like this:

Screenshot 2022-07-26 221709.png

Did you find this article valuable?

Support Rohan Kishore by becoming a sponsor. Any amount is appreciated!