【发布时间】:2018-06-28 17:25:52
【问题描述】:
我正在使用 pygame 让程序等待鼠标点击。我的代码是这样的:
import pygame
import pyautogui
done = True
while done:
event = pygame.event.wait()
if event.type == pygame.MOUSEBUTTONDOWN:
pyautogui.hotkey("ctrlleft")
done = True
但是我收到了这个错误
Traceback (most recent call last):
File "C:/Users/WantedStarling/Desktop/pygame.py", line 1, in <module>
import pygame
File "C:/Users/WantedStarling/Desktop\pygame.py", line 5, in <module>
event = pygame.event.wait()
AttributeError: 'module' object has no attribute 'event'`enter code here`
有人可以帮忙吗?
【问题讨论】:
标签: pygame