Python 编程从入门到实践一书中,外星人项目里14章按键
编码应该没有问题,按书录入后,提示这个,这个是什么原因???Traceback(mostrecentcalllast):File"alien_invasion.py",l...
编码应该没有问题,按书录入后,提示这个,这个是什么原因???
Traceback (most recent call last):
File "alien_invasion.py", line 41, in <module>
run_game()
File "alien_invasion.py", line 20, in run_game
play_button = Button(ai_settings, screen, "Play")
File "C:\Users\樊荣\Desktop\alien_invasion\button.py", line 11, in __init__
self.font = pygame.font.SysFont(None, 48)
File "C:\Users\樊荣\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pygame\sysfont.py", line 320, in SysFont
return constructor(fontname, size, set_bold, set_italic)
File "C:\Users\樊荣\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pygame\sysfont.py", line 243, in font_constructor
font = pygame.font.Font(fontpath, size)
OSError: unable to read font file 'C:\Users\樊荣\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pygame\freesansbold.ttf' 展开
Traceback (most recent call last):
File "alien_invasion.py", line 41, in <module>
run_game()
File "alien_invasion.py", line 20, in run_game
play_button = Button(ai_settings, screen, "Play")
File "C:\Users\樊荣\Desktop\alien_invasion\button.py", line 11, in __init__
self.font = pygame.font.SysFont(None, 48)
File "C:\Users\樊荣\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pygame\sysfont.py", line 320, in SysFont
return constructor(fontname, size, set_bold, set_italic)
File "C:\Users\樊荣\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pygame\sysfont.py", line 243, in font_constructor
font = pygame.font.Font(fontpath, size)
OSError: unable to read font file 'C:\Users\樊荣\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pygame\freesansbold.ttf' 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询