May-06-2021, 02:54 PM
Thaks all for your replies and suggestions.
I am aware of several potential solutions. Being new to Python, I just wanted to be sure I'm not doing something wrong.
I also found similar isseus with Int:
And a comment as for the "==True", yes, I know it is not necessary, but I never save on clarity. A program should be as detailed as possible. After many years programming in several languages (new to Python, though), I know how difficult it can be to try to understand a program I made myself some 20 years back. (by the way, the True was not always the obvious default. In the past the '== True' was a must.
And one more related comment:
In good programming, eception handling must not be used as a logic programming item. The best practice is to avoid any exception handling while writing the code, and add it only after the code has been completed and tested. It is intended for the unknown or system errors, not for bugs correction or logic decissions.
In addition, the exception handling, if active while programming and testing, will hide other importand error messages.
I am aware of several potential solutions. Being new to Python, I just wanted to be sure I'm not doing something wrong.
I also found similar isseus with Int:
Quote:if target.get().isdigit() == False or target.get() == '' or target.get() == None :
AttributeError: 'int' object has no attribute 'isdigit'
And a comment as for the "==True", yes, I know it is not necessary, but I never save on clarity. A program should be as detailed as possible. After many years programming in several languages (new to Python, though), I know how difficult it can be to try to understand a program I made myself some 20 years back. (by the way, the True was not always the obvious default. In the past the '== True' was a must.
And one more related comment:
In good programming, eception handling must not be used as a logic programming item. The best practice is to avoid any exception handling while writing the code, and add it only after the code has been completed and tested. It is intended for the unknown or system errors, not for bugs correction or logic decissions.
In addition, the exception handling, if active while programming and testing, will hide other importand error messages.