简体   繁体   中英

Unused variable 'buttons' pylint(unused-variable)

I am working on creating a simple Tic-Tac-Toe game, through tkinter module. And there seems to be a
Unused variable 'buttons' pylint(unused-variable)
in the following part of my code:

buttons=tk.StringVar()

    def btnClick(buttons):
        nonlocal bclick,p1Name,p2Name,p1,p2,flag
        if buttons["text"] == " " and bclick == True:
            buttons["text"] = "X"
            bclick = False
            p1 = p1Name.get() + " Wins!"
            win_check()
            flag = flag+1
        elif buttons["text"] == " " and bclick == False:
            buttons["text"] = "O"
            bclick = True
            p2 = p2Name.get() + " Wins!"
            win_check()
            flag = flag+1
        else:
            showinfo("Tic-Tac-Toe", "Button already Clicked!")

Please note that the above code is inside a method, thus the indentation.

I am working on creating a simple Tic-Tac-Toe game, through tkinter module. And there seems to be a
Unused variable 'buttons' pylint(unused-variable)
in the following part of my code:

buttons=tk.StringVar()

    def btnClick(buttons):
        nonlocal bclick,p1Name,p2Name,p1,p2,flag
        if buttons["text"] == " " and bclick == True:
            buttons["text"] = "X"
            bclick = False
            p1 = p1Name.get() + " Wins!"
            win_check()
            flag = flag+1
        elif buttons["text"] == " " and bclick == False:
            buttons["text"] = "O"
            bclick = True
            p2 = p2Name.get() + " Wins!"
            win_check()
            flag = flag+1
        else:
            showinfo("Tic-Tac-Toe", "Button already Clicked!")

Please note that the above code is inside a method, thus the indentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM