So today we will learn how to auto login in a tab using Python.
So, let’s first see the code, and then we will understand the code through comments.
Code
# importing the tkinter module from tkinter import * # defining a function def fun(): # defining autologin function and upon calling this function # values for username and password will be autowritten def autologin(): # setting username as coding community username.set("coding community") # setting secret password password.set("****************") # initializing tkinter login_screen = Tk() # setting gui title login_screen.title("Auto login with python") # setting gui geometry login_screen.geometry("300x250") # creating a text label widget and packing it Label(login_screen, text="Please enter login details").pack() # creating a text label widget and packing it Label(login_screen, text="Username").pack() # declaring a string type variable to store username from # entry widget username = StringVar() # declaring a string type variable to store password from # entry widget password = StringVar() # creating a entry widget to take username username_login_entry = Entry(login_screen, textvariable=username) # packing entry widget on gui screen username_login_entry.pack() # creating a text label widget and packing it l1 = Label(login_screen, text="Password").pack() # creating an entry widget to take password from user password_login_entry = Entry(login_screen, textvariable=password) # packing the entry widget password_login_entry.pack() # adding button to application screen to call autologin # function Button(login_screen, text="Apply auto fill", command=autologin).pack() # adding button to applicaton screen to ask user to login Button(login_screen, text="Login Now", width=10, height=1).pack(pady=10) # running the mainloop when the code is ready login_screen.mainloop() fun()
Thanks for visiting the site
Keep in touch with our site for more amazing material like this
Also read:
- Simple Code to compare Speed of Python, Java, and C++?
- Falling Stars Animation on Python.Hub October 2024
- Most Underrated Database Trick | Life-Saving SQL Command
- Python List Methods
- Top 5 Free HTML Resume Templates in 2024 | With Source Code
- How to See Connected Wi-Fi Passwords in Windows?
- 2023 Merry Christmas using Python Turtle
- 23 AI Tools You Won’t Believe are Free
- Python 3.12.1 is Now Available
- Best Deepfake Apps and Websites You Can Try for Fun
- Amazon launched free Prompt Engineering course: Enroll Now
- 10 GitHub Repositories to Master Machine Learning
- Hello World in 35 Programming Languages
- How to Scrape Data From Any Website with Python?
- Become Job Ready With Free Harvard Computer Science course: Enroll Now
- Free Python Certification course from Alison: Good for Resume
- Download 1000+ Projects, All B.Tech & Programming Notes, Job, Resume & Interview Guide, and More – Get Your Ultimate Programming Bundle!
- Udacity Giving Free Python Course: Here is how to Enroll
- Love Babbar’s Income Revealed
- Top 5 Websites to Learn Programming in 2024
- Python Internship for college students and freshers: Apply Here
- Microsoft Giving Free Python Course in 2023: Enroll Now
- Top 5 Free Python Courses on YouTube in 2024
- Complete Python Roadmap for Beginners in 2024
- New secrets to Earn money with Python in 2024
- Connect with HR Directly – Job Hack
- Google offering free Python course: Enroll Today
- What is an AI Tool?
- Google Internship 2024
- TCS Launched Free Certification Course with Industry Recognized Value