0

I'm using Tkinter (with python) to create a UI. How can I use the entry (which defines the user name) from one page on another page (thus another class)? Basically, I need the user name to appear on several pages without asking the user to enter it each time.

2 Answers 2

1

you can make it a global variable.

global password
password_entry = tk.Entry(screen1, show="*", textvariable=password)

And then use it anywhere in your program

Sign up to request clarification or add additional context in comments.

Comments

0

I don't know do you have any database which includes the usernames. If yes you can get it from there. if not, so you can use global variable to keep username.

global username
username = textbox.get("1.0","end")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.