Question: 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:

I am using tKinter and Python. I need the output to just

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) 

print the result string in a normal way onto the actual GUI.

('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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!