slither.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:Slither 作者: PySlither 项目源码 文件源码
def loadSound(self, name):
        '''Load a sound. Set this function to a variable then call variable.play()'''
        try:
            pygame.mixer.get_init()
        except:
            pass
        class NoneSound:
            def play(self): pass
        if not pygame.mixer:
            return NoneSound()
        fullname = os.path.join(scriptdir, name)
        try:
            sound = pygame.mixer.Sound(fullname)
        except pygame.error as e:
            print ('Cannot load sound: %s' % fullname)
            raise e
        return sound
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号