Kyle
Kyle

Reputation: 23

Visual Studio Code - Unused Import Warning - Python

When importing the Tkinter module, VS Code gives me a 100+ warning messages about unused imports. Is there a way to turn this off? Or should I be doing something different to avoid this?enter image description here

Upvotes: 1

Views: 996

Answers (1)

willturner
willturner

Reputation: 104

Becuase you're using from tkinter import * python is importing everything in the tkinter module. You then get a warning for each class in tkinter that you aren't using. You can either just import the classes you need (from tkinter import Tk), or turn off the warnings in visual studio settings (Tools > Options > Python).

Upvotes: 2

Related Questions