Skip to content

Instantly share code, notes, and snippets.

@hosackm
Created June 25, 2015 06:23
Show Gist options
  • Save hosackm/e46a268e7beadcb17f0d to your computer and use it in GitHub Desktop.
Save hosackm/e46a268e7beadcb17f0d to your computer and use it in GitHub Desktop.
pymidi cffi backend
import subprocess
from cffi import FFI
__all__ = ('ffi',)
p = subprocess.Popen(['clang -E include/portmidi.h'],
shell=True, stdout=subprocess.PIPE)
code = p.communicate()[0]
ffi = FFI()
ffi.cdef(code)
if __name__ == '__main__':
ffi.set_source('_pymidi', None)
ffi.compile()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment