Feb-17-2022, 10:30 PM
(This post was last modified: Feb-22-2022, 03:50 PM by deanhystad.)
I used .place(x, y) to mimic your code. You should stop using .place() and use .pack() or .grid() instead.
Become a lazy typer. You should never type this many characters
Don't use mixed case variable names unless forced. Python style guidelines associate special meanings with capital letters, Try to follow the style laid out in https://pep8.org/. Start using it early and it will become second nature. Once you are used to the style you'll find it really helps you read Python code.
Become a lazy typer. You should never type this many characters
if chkbxItemCard.get() == 1 or chkbxPicklist.get() == 1 or chkbxQuickPick.get() == 1: btnConvert["state"] = "normal" if chkbxItemCard.get() == 0 and chkbxPicklist.get() == 0 and chkbxQuickPick.get() == 0: btnConvert["state"] = "disabled"When you can type this instead:
if any(cb.get() == 1 for cb in (chkbxitemCard, chkbxPicklist, chkbxQyickPick)): btnConvert["state"] = "normal" else: btnConver["state"] = "disabled"Not only is it less typing, it has less ability to hide errors and is easier to read. My way makes it obvious that the two possibilities are any checked or none checked. Your way I have to look at each of the comparisons and each of the logic operations
Don't use mixed case variable names unless forced. Python style guidelines associate special meanings with capital letters, Try to follow the style laid out in https://pep8.org/. Start using it early and it will become second nature. Once you are used to the style you'll find it really helps you read Python code.