“variable” May be undefined or defined from star imports: tkinter

后端 未结 2 971
醉话见心
醉话见心 2020-12-18 13:51

I\'m trying to make a simple outline for a gui, and I\'m getting the warning \"variable\" May be undefined or defined from star imports: tkinter for all of my variables.

2条回答
  •  庸人自扰
    2020-12-18 14:22

    from tkinter import *

    In this line, you import everything from tkinter. This is not recommended, so linter will warn you. But if you really want to do this, it's OK, just ignore it.

    To be better, you should explicitly import what you need. For example:

    from tkinter import Tk, Label, Frame, Entry, Button
    

提交回复
热议问题