level 6
木口诀233
楼主
本人菜鸟一只,某日输入了以下代码:
—————————以下为代码———————————
import pygame
file='G:\py\Despair.mp3'
pygame.mixer.init()
track=pygame.mixer.music.load(file)
while 1:
q=input('按【Enter】播放,再次按【Enter】停止。')
if pygame.mixer.music.get_busy()==False:
print('Music begin!')
pygame.mixer.music.play(5)
elif q=='':
pygame.mixer.music.stop()
print('Music stop.')
break
—————————代码已结束———————————
但是运行时出现了这样的问题(不是红字):
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>
============================ RESTART: G:\py\music.py ===========================
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
================================ RESTART: Shell ================================
>>>
求大佬指教,为啥会这样呢?
2020年02月25日 07点02分
1
—————————以下为代码———————————
import pygame
file='G:\py\Despair.mp3'
pygame.mixer.init()
track=pygame.mixer.music.load(file)
while 1:
q=input('按【Enter】播放,再次按【Enter】停止。')
if pygame.mixer.music.get_busy()==False:
print('Music begin!')
pygame.mixer.music.play(5)
elif q=='':
pygame.mixer.music.stop()
print('Music stop.')
break
—————————代码已结束———————————
但是运行时出现了这样的问题(不是红字):
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>
============================ RESTART: G:\py\music.py ===========================
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
================================ RESTART: Shell ================================
>>>
求大佬指教,为啥会这样呢?