Skip to content
Advertisement

How to print Dictionary’s items in Tkinter Text Widget?

I have created a program, which allows user to enter usernames of individuals and assign specific number (points) to a particular name.

As a result, all data is stored in dictionary like that:

JavaScript

When User click on “Results” Button, new window appear and I can see this dictionary printed in terminal. However, now I want to print the data of this dictionary in Text box in new Tkinter window. I tried to do so, but nothing appears in text box.

Or I should use label widget to do so?

How to solve this problem?

I’m thinking that I should change something here, but I don’t know what exactly

JavaScript

Here is the working part of my code:

JavaScript

Advertisement

Answer

Does this fix Your issue (changes to the code You said wasn’t working):

JavaScript

First of I added values to IndividPoints and second I actually packed the frame so that is on screen (You will have to adjust that accordingly but this example works)

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement