Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use cx_Freeze if the file packaged is not a .pyc file, but a. pyd file? #1911

Open
zhenzi0322 opened this issue Jun 13, 2023 · 6 comments
Labels

Comments

@zhenzi0322
Copy link

zhenzi0322 commented Jun 13, 2023

Are there any parameters that can be used directly

image

@marcelotduarte
Copy link
Owner

marcelotduarte commented Jun 14, 2023

I do not understand what you want. Maybe the answer is in the documentation.

.py: usually the input source code you wrote.
.pyc: is the compiled bytecode. If you import a module, Python will build a *.pyc file that contains the bytecode to make it easier and faster later.
.pyd: It's basically a Windows dll file.

@marcelotduarte marcelotduarte changed the title How to use cx_ The file packaged with Freeze is not a. pyc file, but a. pyd file. Are there any parameters that can be used directly How to use cx_Freeze if the file packaged is not a .pyc file, but a. pyd file? Jun 14, 2023
@zhenzi0322
Copy link
Author

Can we output pyd files

@marcelotduarte
Copy link
Owner

Yes, using Cython. If you have a module .py (or .pyx) you can make .pyd with Cython, then use cx_Freeze to make the executable, the .pyd is automatically chosen.

@zhenzi0322
Copy link
Author

Using cx_ Freeze Can't you directly create output for pyd files?

@marcelotduarte
Copy link
Owner

No. But, the creation of .py to .pyd and the build can be made in the setup.py used to build the executable.
To convert a .py to C and build a .pyd (.dll) is a bit complex, so exist Cython and others. I used Cython.

@zhenzi0322
Copy link
Author

Ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants