I've just started my code (python 3.8.2) and VScode (version 1.43.0) came up with the "Module 'pygame.locals' has no 'QUIT'" in the line if event.type == pg.locals.QUIT:
(I've imported pygame as "pg"). I've looked around and some people said to do from pygame.locals import *
and just do if event.type == QUIT
but when I do that I get "Undefined variable 'QUIT'" (it also states that "QUIT" is an int?). So I'm not too sure whats going on.
(Stack overflow article I looked at)
here's all of the relevant code:
import tkinter as tk
import pygame as pg
import threading as thr
from pygame.locals import *
def pygameQuitSubprocess():
while True:
for event in pg.event.get():
if event.type == QUIT:
quit()
pass
just for context, I am planning to run this function in a subprocess so I can run the rest of my code at the same time. If anyone can tell me why that would be a bad idea or why that wouldn't work or so forth, please do, I am very new to threading. But this isn't super important right now.