r_value= StringVar()
r_value.set("R <= 10k")
def less10k():
enrvalue0 = Vp/0.001 #enr formula for 1 mA
return enrvalue0
Radiobutton(in_frame, text="Resistance Less than or Equal to 10k",variable=r_value, value="R <= 10k",font=24,command=less10k).grid(row=0,column=1,sticky="W")
def great10k():
enrvalue1 = Vp/0.0001 #enr formula for 0.1 mA
return enrvalue1
Radiobutton(in_frame, text="Resistance Greater than 10k", variable=r_value, value="R > 10k",font=24,command=great10k).grid(row=1,column=1,sticky="W")
pot=r_value.get()
if pot=="R <= 10k":
enrvalue=less10k()
print(0)
else:
enrvalue=great10k()
print(1)
if enrvalue<100:
result =Label(out_frame, text="PASS", fg="white", bg="green", font=108,width=10,height=5).grid(row=0,column=4,rowspan=4)
else:
result =Label(out_frame, text="FAIL", fg="white", bg="red", font=108,width=10,height=5).grid(row=0,column=4, rowspan=4)
I want that if I select 'R <= 10' it should select formula for 'enrvalue=Vp/0.001' and if I change to 'R > 10k' it should select 'enrvalue=Vp/0.0001'. and also i want 'enrvalue' further to compare it by ideal value(100). i want to know how can i change the value of 'pot' it always stick to my preset value of 'R <= 10k'.