I am trying to make a slider in python with tkinter, and have a loop continuously update the data from the slider. In the end product I want a row of leds light up verbatim to the slider. The problem is that the while loop stops the rest of the code from working and the window with the slider won't open. Here is my code:
import RPi.GPIO as GPIO
from tkinter import *
GPIO.setmode(GPIO.BCM)
GPIO.setup(26, GPIO.OUT)
GPIO.setwarnings(False)
def value():
led.get()
master = Tk()
master.geometry('100x100')
led = Scale(master, from_=5, to=1)
led.pack()
while True:
print(value())
mainloop()