编码应该没有问题,按书录入后,提示这个,这个是什么原因???Traceback(mostrecentcalllast):File"alien_invasion.py",line41,inrun_game()File"alien_invasion.py",line2...
编码应该没有问题,按书录入后,提示这个,这个是什么原因???
Traceback (most recent call last):
File "alien_invasion.py", line 41, in
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'
展开