I have developed a program with Python language and I want to finally provide this program as an executable file for Windows.(as a .exe file)
To protect the my code, various searches on the Internet and Google suggested that I use the Cython
library
which is the link of the sites I read:
https://ron.sh/compiling-python-code-with-cython/
In the example of this site, there are codes in the setup.py
file and it executes this file with the following command
python setup.py build_ext --inplace
And after executing this command, the following files will be added to the path of the program
module.c
module.cp37-win_amd64.pyd
According to the explanations I have given and the example of the website itself, my problems are these
First, module.cp37-win_amd64.pyd
is not generated for me
Second, how can I use the module.c
file and call the function inside this file?
In the following, the example given on the site uses the following code snippet
from module import hello
if __name__ == '__main__':
hello()
Message for me:
DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or c heck PEP 632 for potential alternatives
from distutils.core import setup
Compiling mytest.py because it changed.
[1/1] Cythonizing module.py
running build_ext
building 'module' extension
error: Unable to find vcvarsall.bat
I use Windows for Python programming
But from module import hello is imported from the module.py
file, not from the module.c
file, and if I want to give the program as an executable file to the user, he can see my codes.
I thank anyone who can help me to solve this problem and protect my code