简体   繁体   中英

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.

My code keeps getting stuck on the line 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.

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 .

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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