You should do if-elif-elif with e.type. First import the event contansconstants you need to check from pygame.constants For example
from pygame.constants import QUIT, MOUSEBUTTONDOWN
while true:
for e in pygame.event.get():
if e.type == QUIT:
#close the game
elif e.type == MOUSEBUTTONDOWN:
#mouse click
The dir() function gives the directory where a module is located, that doesn't work as you think