Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have the following program that takes the input from the user and then shows it in GUI but I need to store the input

I have the following program that takes the input from the user and then shows it in GUI

but I need to store the input in a variable and use it later after closing the GUI in another part of the code

from tkinter import *

ws = Tk() ws.title("PythonGuides") ws.geometry('400x300') ws['bg'] = '#ffbf00'

def printValue(): pname = player_name.get() Label(ws, text=f'{pname}, Registered!', pady=20, bg='#ffbf00').pack()

player_name = Entry(ws) player_name.pack(pady=30)

Button( ws, text="Register Player", padx=10, pady=5, command=printValue ).pack()

ws.mainloop()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

Students also viewed these Databases questions

Question

Question Can a self-employed person adopt a money purchase plan?

Answered: 1 week ago