def main(args):
return 0
import tkinter as tk
window = tk.Tk()
increasingNumber = 0
fileName = f"newFile{increasingNumber}.txt"
def createFile():
f = open(fileName, "w")
f.close()
increasingNumber += 1
btn_newFile_txt = tk.Label(window, text="You can press the New File button to create a new file.")
btn_newFile_txt.pack()
btn_newFile = tk.Button(window, text="New File", command=createFile())
btn_newFile.pack()
window.mainloop()
Bu kodu çalıştıdığmda “UnboundLocalError: local variable ‘increasingNumber’ referenced before assignment” hatası alıyorum. Çözümü nedir ?