
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:
- The system of the binary conversion
- What is web development for beginners?
- Guide to Proxy Servers: How They Work and Why You Need Them?
- Python | Check Armstrong Number using for loop
- Python | Factorial of a number using for loop
- Link in bio
- Microsoft Giving Free Machine Learning Course: Enroll Now
- Accenture Giving Free Developer Certificate in 2023
- Python | Asking the user for input until they give a valid response
- Python | How to iterate through two lists in parallel?
- Amazon Summer Internship 2023
- Python | How to sort a dictionary by value?
- Amazon Giving Free Machine Learning Course with Certificate: Enroll Now
- Google Summer Internship 2023
- Python | How to split a list into equally-sized chunks?
- 5 Secret ChatGPT skills to make money
- Python | Remove items from a list while iterating
- Free Google Certification Courses
- 5 AI tools for coders better than ChatGPT
- Python | How to get dictionary keys as a list
- New secrets to Earn money with Python in 2023
- Flower classification using CNN
- How to represent Enum in Python?
- 5 methods | Flatten a list of lists | Convert nested list into a single list in Python
- What does if __name__ == __main__ do in Python?
- Music Recommendation System in Machine Learning
- Brick Breaker Game in C++
- Dino Game in Java
- Java Games Code | Copy And Paste
- How to utilize ChatGPT to improve your coding skills?