简体   繁体   English

使用非标准库冻结无错误代码

[英]Freezing with no error codes using non-standard library

I'm doing some work with a MIDI controller called the Novation Launchpad that has a python module available to import and use. 我正在使用名为Novation Launchpad的MIDI控制器进行一些工作,该控制器具有可导入和使用的python模块。

My code keeps getting stuck on the line LP = launchpad.Launchpad() . 我的代码一直卡在LP = launchpad.Launchpad() So here is how I've attempted to de-bug: 所以这是我尝试调试的方式:

import launchpad
print "I've started"
LP = launchpad.Launchpad()
LP.Open()
print "I worked!"

The programme never prints I've worked so I know my issue is in the creation of the Launchpad instance. 该程序从不打印I've worked的程序,所以我知道我的问题在于创建Launchpad实例。

Using a friends laptop we've had no issues. 使用朋友笔记本电脑,我们没有任何问题。 I've had intermittent issues with it working and not working and really don't even know where to start looking! 我遇到了间歇性问题,无法正常工作,甚至不知道从哪里开始寻找!

So, after finding a programme that would run with those commands, it became clear quickly that I hadn't initiated pygame and pygame.midi . 因此,在找到可以使用这些命令运行的程序之后,很快就知道我没有启动pygamepygame.midi

import pygame, pygame.midi, launchpad

pygame.init()
pygame.midi.init()
print "I've started"
LP = launchpad.Launchpad()
LP.Open()
print "I've worked"

Will run just fine. 会运行的很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM