The smallest possible windows executable from the python script

advertisements

I've looked at some projects like py2exe and a couple other ones. But I want really small under 1mb would be cool but under 300kb would be ideal. Are there any project to possibly extern python into a C compiler or even convert python to C? Maybe there is just a really small python interpreter that I could add only the required libraries to? ( I tried one, it didn't really seem to be "python")

I've looked at a lot of options but I haven't tried them out properly... What can you recommend? I am willing to put the effort into a more complex process if the payoff(small size) is worth it, but I need to narrow down the list.


I mean the closest you will get with python is py2exe and UPX Create the exe but don't bundle anything to it instead make a library then use upx and do the best compression. It has little overhead and can trim another few mb off your final product. Its not the best way but its one of them.

The other option would be to write a snub launcher in C or C++ to fire up a python interpreter and run your source code. While this would be much smaller it would probably be far more complicated to make, if you are looking to follow this method then this link will help you with that.