I try to converte python program to exe file, I use Cython to convert it to .c file and now I use gcc in windows to convert the .c program to exe file but that doesn't work please how can help me and show me step by step how I do that? Just to know I use Python 3.5 version.
Asked
Active
Viewed 1,758 times
0
-
You want to convert a python script to an executable or a cython script to an executable? Either way, this is a duplicate question – Chris_Rands Mar 06 '17 at 14:30
-
convert python script to executable file using cython – G.Rami Mar 06 '17 at 14:33
-
why would you use cython to create an executable? that's not what cython is for? you could use py2exe, cx_freeze or similar – Chris_Rands Mar 06 '17 at 14:34
-
ok,when I use py2exe or pyinstaller or cxfreeze I get exe file for my scripte but when I execute that file in other PC I have problem there is a dll file doesn't exist, But when I see a C program compilling by code block for exemple is work...I think If I can convert py to c and than convert it to exe it will work – G.Rami Mar 06 '17 at 14:38
-
See also http://stackoverflow.com/questions/12059509/create-a-single-executable-from-a-python-project/12059644#12059644 – DavidW Mar 06 '17 at 15:12
-
However: using Cython to generate an exe will not be as useful as you think. You will _still_ require the Python dll to be present and you will most likely need large chunks of the Python standard library to be installed for any non-trivial program - it does not remove these dependencies – DavidW Mar 06 '17 at 15:13
-
DavidW if is like you say Please tell me why exe file created by code block from C program work in all computers – G.Rami Mar 06 '17 at 15:44
-
@G.Rami I don't quite understand exactly what you're asking but: 1) the exe Cython generates links to the libpython dll file; 2) Cython does not compile any thing you import, so these files need to be in the Python path in the normal way. You cannot easily avoid this. – DavidW Mar 06 '17 at 17:23
1 Answers
1
You can use cx_Freeze to converte python program to exe immediately.
cx_Freeze is a set of scripts and modules for freezing Python scripts into executables. cx_Freeze is cross platform and should work on any platform that Python itself works on. It supports Python 2.7 or higher (including Python 3).
see at: http://cx-freeze.readthedocs.io/en/latest/overview.html

G.F.
- 26
- 4
-
I try with that but when I run the exe file in other PC is doesn't work, dll file doesn't exist. – G.Rami Mar 06 '17 at 15:04
-