Code: Select all
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.13_3.13.496.0_x64__qbz5n2kfra8p0\Lib\tkinter\__init__.py", line 2068, in __call__
return self.func(*args)
~~~~~~~~~^^^^^^^
File "C:\Users\falso\Desktop\Development\Software\1.py", line 10, in generate_random_value
result_label.config(text=random_values)
^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'result_label' where it is not associated with a value
< /code>
Hier ist das aktuelle Skript < /p>
import tkinter as tk
import random
def generate_random_value():
try:
num_values = int(entry.get())
if num_values > 0 and num_values