Here is a full example that should work:

# File: my_library.pyx

def multiply(a, b):
    return a * b

# End of file


# File: my_app.py

import my_library

print my_library.multiply(3, 8)

Using Cython, you compile my_library.pyx into my_library.c. Then using GCC, you compile my_library.c into my_library.so. At this point, you can run my_app.py:

linux> python my_app.py
24

Then you bundle it with PyInstaller like this (the first line is severely simplified because I don't remember the necessary options):

linux> python pyinstaller.py my_app.py

linux> ./my_app
24

In this case, my_app.py is the "small Python bootloader". my_library.pyx contains the super secret source code that is now hidden. The key idea is that you point PyInstaller at my_app.py as the "base file" to be bundled.

My scheme never created any .pyd files, it created .so files instead.

Zak Fallows

--
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to