- 帖子
- 31
- 精华
- 0
- 积分
- 164
- 阅读权限
- 20
- 注册时间
- 2021-4-10
- 最后登录
- 2022-11-13
|
使用python3.9,代码如下:- import pygame, sys
- pygame.init()
- screen = pygame.display.set_mode([640, 480])
- while True:
- for event in pygame.event.get():
- if event.type == pygame.QUIT:
- sys.exit()
复制代码 报错:- Traceback (most recent call last):
- File "F:\pygame's code\pygame.py", line 1, in <module>
- import pygame, sys
- File "F:\pygame's code\pygame.py", line 2, in <module>
- pygame.init()
- AttributeError: partially initialized module 'pygame' has no attribute 'init' (most likely due to a circular import)
复制代码 why??????? |
|