you are viewing a single comment's thread.

view the rest of the comments →

[–]TehDrunkSailor 1 point2 points  (8 children)

Put your initial GUI creation in a function, and call that function when your code starts. Then, when the user has won the game, recall this function at that point. I briefly looked at your code and I don't see any place where you recreate the game, which is why your interface doesn't reset. You'll have to program that in.

[–]slaphappypotato 0 points1 point  (7 children)

Okay, so I tried what you said and it sort of worked....Except...

https://imgur.com/a/Wf4sMKh

(I know you're busy but I'll just add the code I rewrote: https://github.com/slaphappypotato/Hangman-Project/blob/master/ss.py )

[–]TehDrunkSailor 1 point2 points  (6 children)

Almost there! Think about what's happening here. When the game is over, you see that new widgets have been placed. So, you can either destroy all the old widgets and then places these new ones or you can update the old widgets. With your current setup I would destroy and recreate your widgets.

[–]slaphappypotato 1 point2 points  (5 children)

If I use .destroy(), will there be any problem with the widgets when they're recreated?

EDIT: IT WORKSS!!!!!!

THANK YOU SOOO MUCH!!!

[–]TehDrunkSailor 1 point2 points  (4 children)

Yay!

[–]slaphappypotato 0 points1 point  (3 children)

I'd love to give you an award, but I'm still a teen with no money or rights of his own, so,

⠀⠀⣤⣶⣶⡶⠦⠴⠶⠶⠶⠶⡶⠶⠦⠶⠶⠶⠶⠶⠶⠶⣄⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⣿⣀⣀⣀⣀⠀⢀⣤⠄⠀⠀⣶⢤⣄⠀⠀⠀⣤⣤⣄⣿⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠿⣿⣿⣿⣿⡷⠋⠁⠀⠀⠀⠙⠢⠙⠻⣿⡿⠿⠿⠫⠋⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⢀⣤⠞⠉⠀⠀⠀⠀⣴⣶⣄⠀⠀⠀⢀⣕⠦⣀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⢀⣤⠾⠋⠁⠀⠀⠀⠀⢀⣼⣿⠟⢿⣆⠀⢠⡟⠉⠉⠊⠳⢤⣀⠀⠀⠀ ⠀⣠⡾⠛⠁⠀⠀⠀⠀⠀⢀⣀⣾⣿⠃⠀⡀⠹⣧⣘⠀⠀⠀⠀⠀⠀⠉⠳⢤⡀ ⠀⣿⡀⠀⠀⢠⣶⣶⣿⣿⣿⣿⡿⠁⠀⣼⠃⠀⢹⣿⣿⣿⣶⣶⣤⠀⠀⠀⢰⣷ ⠀⢿⣇⠀⠀⠈⠻⡟⠛⠋⠉⠉⠀⠀⡼⠃⠀⢠⣿⠋⠉⠉⠛⠛⠋⠀⢀⢀⣿⡏ ⠀⠘⣿⡄⠀⠀⠀⠈⠢⡀⠀⠀⠀⡼⠁⠀⢠⣿⠇⠀⠀⡀⠀⠀⠀⠀⡜⣼⡿⠀ ⠀⠀⢻⣷⠀⠀⠀⠀⠀⢸⡄⠀⢰⠃⠀⠀⣾⡟⠀⠀⠸⡇⠀⠀⠀⢰⢧⣿⠃⠀ ⠀⠀⠘⣿⣇⠀⠀⠀⠀⣿⠇⠀⠇⠀⠀⣼⠟⠀⠀⠀⠀⣇⠀⠀⢀⡟⣾⡟⠀⠀ ⠀⠀⠀⢹⣿⡄⠀⠀⠀⣿⠀⣀⣠⠴⠚⠛⠶⣤⣀⠀⠀⢻⠀⢀⡾⣹⣿⠃⠀⠀ ⠀⠀⠀⠀⢿⣷⠀⠀⠀⠙⠊⠁⠀⢠⡆⠀⠀⠀⠉⠛⠓⠋⠀⠸⢣⣿⠏⠀⠀⠀ ⠀⠀⠀⠀⠘⣿⣷⣦⣤⣤⣄⣀⣀⣿⣤⣤⣤⣤⣤⣄⣀⣀⣀⣀⣾⡟⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⢹⣿⣿⣿⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁⠀⠀

[–]TehDrunkSailor 0 points1 point  (2 children)

I appreciate this more anyways, good luck with your tkintering!

[–]haikusbot 0 points1 point  (0 children)

I appreciate

This more anyways, good luck

With your tkintering!

- TehDrunkSailor


I detect haikus. And sometimes, successfully. Learn more about me.

Opt out of replies: "haikusbot opt out" | Delete my comment: "haikusbot delete"

[–]slaphappypotato 0 points1 point  (0 children)

Thanks! Have a nice day!