Reputation: 33
I converted an empty Python file to an exe file with the pyinstaller library, and the exe file size was 6.694 MB. Why was the size of the exe file so large even though the Python file was empty and there was no reference to it? really why?
Upvotes: 0
Views: 999
Reputation: 33
I think I found the answer to my questions myself. In many languages, such as C#, the script file is initially completely empty. In C#, for example, to print text on a console, you must first use the system library, the Console class, WriteLine method, and then do so. While in each Python file you have access to a number of default classes and functions. Including the print function that you can use to easily print text. The size of this raw data in Python files is not small at all. In fact, before the first line of each Python file, there is a line that import the Python default library. I wish Python was completely empty at first.
Upvotes: 2