Pregunta

I'm trying to construct a MIDI message.

quarter_frame = '0x{}{}'.format(i,x)
clock = [0xF1, quarter_frame]
midiout.send_message(clock)

This throws an 'integer required' error.

How can I convert this to an integer?

¿Fue útil?

Solución

>>> int('1234')
1234
>>> int('0xFF', base=16)
255
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top