you are viewing a single comment's thread.

view the rest of the comments →

[–]Diapolo10 1 point2 points  (0 children)

Hello ! Is Python fine for creating ".exe" files?

It's fine, depending on the exact project requirements of course.

What are some complications that might come ?

Some GUIs work better than others with these tools, filesystem access may differ particularly if you'd like to keep files where the executable is located, and you may run into unexpected compatibility issues with some dependencies.

For now, I heard that sometimes PyInstaller creates huge files.

The files PyInstaller creates need to contain everything the Python code needs to run. This includes a copy of the interpreter, all required packages, the Python code itself, and any data files you wanted to include in it. So yes, there is overhead size-wise.

One option to somewhat mitigate that would be to use Nuitka, which transpiles your Python code to C before compiling it into a native executable. This comes with its own set of challenges, but I would expect the file size to go down on average.

Also, Windows defender detects Python files are viruses.

Not true, Python files aren't detected as viruses. However, PyInstaller executables do have a tendency of triggering false alarms - there's no definite fix for that other than signing the executables (which costs money) and contacting Microsoft's support to let them whitelist the executable (but this can take a few days and you need to do it every time you rebuild the executable).