Python Forum

Full Version: Converting Entry field value to integer in tkinter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When I try to convert an entry field value to an integer, I get an error like: 'Invalid literal for int'. How can I convert an entry filed to an integer without getting this error? Below is part of my code. Where I want the variable 'ratep' to equal the integer of the entry field 'ratee'.

ratep = int(ratee.get())
Please post code in bbcode tags, please do not use images see: bbcode
My question was answered. Instead of converting entry field to int, I converted it to float since the value had a decimal.