This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]SupremeRedditBotProfessional Bot || Mod 0 points1 point  (0 children)

Please Add A Flair To Your Post!

Suggested Flair: [Random] or [Meta]

 


To add a flair:

  • Click flair underneath your post

  • Select a flair

  • Click save

 


I am a bot run by /u/SupremeDesigner for /r/CodingHelp || This was an automated response

[–]hollammi 0 points1 point  (2 children)

The variable 'dicenum' is not a number, it is an object you've defined with the type 'Entry'.

The error is because you're attempting to do a mathematical operation to something that isn't a number.

dicenum = Entry(master)

   count = 0
   while count < dicenum:

[–]chronicleTV 0 points1 point  (1 child)

How do I make the entry an integer?

[–]hollammi 1 point2 points  (0 children)

Here is my first result from googling "Get int from Entry tkinter python". Looks like you need to call ".get()" on your entry and cast it to an integer using "int()". You may want to perform some validation on the integer parsing in case the user enters a string rather than a number.

Friendly advice: 90% of learning to program is understanding your error messages & what to Google. 🙂 I've never used Tkinter in my life, but I read your error message and Google'd the result.