Crossin的编程教室
标题:
pygame
[打印本页]
作者:
ZZZZZ
时间:
2021-5-5 14:43
标题:
pygame
使用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???????
作者:
crossin先生
时间:
2021-5-5 23:37
自己的代码不要命名成 pygame.py
命名冲突了
作者:
ZZZZZ
时间:
2021-5-9 21:09
哦哦,我知道了
欢迎光临 Crossin的编程教室 (https://bbs.crossincode.com/)
Powered by Discuz! X2.5