8 odpowiedzi
+ 2
Randych pyinstaller is usually included with python, no need to install it tbh.
python is more than fine for desktop applications. if your code is short indeed and doesn't use many imports, the file will be about 6-7mb.
the file size is entirely unrelated to being high level by the way. it's because python embeds itself as a VM in that .exe, and this means cross-platform compatibility and no requirements like 3rd party redistributables - both of which is generally not true for C/C++ or C#.
also, a few mb are a non-issue in 2019/2020, even with bad internet.
+ 1
pyinstaller script.py -F
+ 1
Programmer Raja (தமிழன்) search its name in Google there you can find it
+ 1
If you're using PyCharm, you can install Pyinstaller in Package Manager, then you need to define it as external tool and then use for your project. Problem is that it has a little use since Python is too high level language and thus you may get 10-40 Mbyte large exe just for a program with few tens of lines.
If you indeed intend to develop autonomous executables, maybe take a look at C family instead?
+ 1
I believe the main intention behind creating Python was to create something that's fun to use, easy to learn and able to convey reasonable coding standards.
And yeah, it's not the best language to create small executables that only carry out minor tasks, but bigger projects don't result in equivalently bigger file sizes. The base file size is pretty high, can't argue with that. But it only gets much bigger when you import a large amount of big libraries and/or add other resources (such as images).
Not to mention you can just omit the -F parameter to get a folder instead of a single file... like I said, I don't think people have such bad internet anymore.
If we're talking about developing something like firmware for a thermostat where the device has extremely little space for your binary (and possibly more important: limited RAM), you're obviously MUCH better off using C++.
For modern computers, however, it probably doesn't make a difference, and pyinstaller is an awesome tool to just share your first few projects with friends who are not gonna bother installing python just to run your stuff.
As for myself, I made the mistake of starting to learn Python in the context of "Ethical Hacking", so my friends don't trust anything I send for some reason. :(
0
Use this app (Py2EXE)
0
Saboor Hakimi how to get that app ?
0
Gregor Dietrich I totally agree with you, but still even 10Mb is a bit overkill and not what's Python is generally intended for imho.