Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am using tKinter and Python. I need the output to just print the result string in a normal way onto the actual GUI. As

I am using tKinter and Python.

I need the output to just print the result string in a normal way onto the actual GUI. As you can see below, it prints the result to the GUI in literal string format:

image text in transcribed

But I just want to to say "California has a population of 7164228 for the year selected". I am not sure if there is another way to do it or not. The last two lines of the if statement are where the print statement to the console, and to the GUI come into play.

for i in range(len(stateNameCol)): if stateName_info == stateNameCol[i]: print(stateName_info, 'has a population of', year[i], 'for the year selected') #stateName_info and year are variables for the state name and year pulled from an excel sheet with all 50 states and their populations printIt = (stateName_info, 'has a population of', year[i], 'for the year selected') ttk.Label(mainframe, text= str(printIt)).grid(column=4, row=9, sticky=W) 

image text in transcribed

('California', 'has a population of', 7164228, 'for the year selected') 28 print(selected_state, selected_year)# StateName_into) 29 30 Leapliest.py Le popgen.py excelTest.py External Libraries Scratches and Consoles 1-D-D 31 32 33 for i in range(len(stateNameCol)): if stateName_info stateNameCol[i]: print(stateName_info, 'has a population of', year[i], 'for the year selected') printIt = (stateName_info, 'has a population of', year[i], 'for the year selected') ttk.Label(mainframe, text= str(printIt)).grid(column=4, row=9, sticky=W) 34 A 35 36 except Exception as e: ttk.Label(mainframe, text=str(e)).grid(column=4, row=9, sticky=W) 37 38 39 Population Generator Enter State Name: California oogle.com/settings/security/lesssecureapps") Enter Year: 2002 Search Population ('California', 'has a population of', 7164228, 'for the year selected') pulationGenerator/xcelTest.py the year is 2002 California has a population of 7164228 for the year selected IRI

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

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions

Question

6. Describe why communication is vital to everyone

Answered: 1 week ago

Question

1.The difference between climate and weather?

Answered: 1 week ago

Question

1. What is Fog ?

Answered: 1 week ago

Question

How water vapour forms ?

Answered: 1 week ago

Question

What is Entrepreneur?

Answered: 1 week ago

Question

Which period is known as the chalolithic age ?

Answered: 1 week ago

Question

Do you currently have a team agreement?

Answered: 1 week ago

Question

How will the members be held accountable?

Answered: 1 week ago