I am new to Python programming and i am having trouble with a few lines of code that should be easy. The code is below. It is a very simple part of my program.
When i run this code in PythonWin line 57 puts on my screen a 0 or a 1 depending whether i have selected something in another part of the program. Line 58 prints out the feeder name. Line 59 is the problem. When i print this out it shows that mY_label is equal to "NONE". Why would line 57 show correctly and line 59 does not?
Thanks for any assistance.
Solved! Go to Solution.
Try printing the value of the button (assuming you are using tkinter):
print(CheckVar1.get())
If that provides the output you are looking for add that to your if statement:
if CheckVar1.get() == 1:
print("pri_oh = 1")
else:
print("pri_oh = 0")
Try printing the value of the button (assuming you are using tkinter):
print(CheckVar1.get())
If that provides the output you are looking for add that to your if statement:
if CheckVar1.get() == 1:
print("pri_oh = 1")
else:
print("pri_oh = 0")
Jeremy,
Thanks a lot for the help. This code worked perfect. I knew it had to be simple but i had run out of ideas.