-6

I have a question, So I want to ask that, Can pyinstaller convert any python program to exe. Even if the program is very large or too short. If pyinstaller can't then how can we convert python program into exe in a professional way, like big companies do? If I want to show that program in production, then how can I convert my program into EXE?

Please answer my question, and every answer will be appreciated, Also sorry for bad english

  • Does this answer your question? [How can I convert a .py to .exe for Python?](https://stackoverflow.com/questions/41570359/how-can-i-convert-a-py-to-exe-for-python) – Ruli Jan 17 '21 at 07:48
  • No I know how to make exe, but I just want to ask Can pyinstaller convert any python program to exe. Even if the program is very large or too short. If pyinstaller can't then how can we convert python program into exe in a professional way, like big companies do? If I want to show that program in production, then how can I convert my program into EXE? –  Jan 17 '21 at 08:19
  • 2
    It's a piece of software, so of course there are limitations. – martineau Jan 17 '21 at 08:43
  • Yeah but I just wanna know how big companies convert it to exe or what is the process to do it in professional way! –  Jan 18 '21 at 07:13
  • it is generally not a good standard to convert python to exe, unless you are absolutely forced to do so. python is an interpreted language, instead of a compiled language (like c++) - compiled languages can quite easily produce an executable. The way pyinstaller creates an executable, is by basically packaging the entire python installation into the exe, and using that to run your script. So yes, it should be possible to convert a script no matter how small or large it is. But there is no guarantee it will be quick or work for every user – oskros Jan 18 '21 at 07:21
  • Okay thanks for your opinion, Umm so you mean I that should convert python code to C++, If I do then, in which language should I convert, C++ or C –  Jan 18 '21 at 07:33
  • Just forget it. If you're going to make a professional exe, use another language. If you must, you can download Python's embeddable zip file which can embed a python interpreter along with your code, making it fully independent. Then you can zip it up using 7zip SFX and add a command to execute after the SFX extracts. –  Feb 01 '21 at 02:56
  • 1
    Yes, I agree with @HACKERALERT. You cannot really convert a Python program to .exe seamlessly. In some cases, when I needed to, I would locate my python installation, copy Python from there, then have a little batch script to run it. Then I would finally make a shortcut for the file, set it to run the script, add a setup.py file to install dependencies, and package everything with IExpress. Notice, I didn't make an .exe. The "big companies" don't convert Python to .EXE, they use other languages/tools, such as Electron. They only use Python on the backend, where it most powerful. – Dukk Feb 24 '21 at 20:28

1 Answers1

0

Yes in the command line just go into the directory in which your python file is located then type pyinstaller filename. py

  • 1
    Sorry bro I know this but the question is different, Anyway I'll upvote. Thanks for your answer! –  Jan 18 '21 at 08:05