Learning a new way to release and package python source code
This article is one part of learning notebook after I read the youtube-dl's source code, I learned a lot of knowledge from this software, I guess the most interesting part is found two porn website inside it, haha.
The anther interesting thing, I learned from its source code, is a python packaging technology. It is a new way to release or publish python software. Before I learned this way, I always use the following two methods to publish python software.
- Just release the raw source code.
- Use the package management tools like setuptools or distutils
But, youtube-dl release itself in a standalone executable single file. So I read its build script, it zipped all its source code into a package and it is its way to make an executable file. I guess python interpreter has the capacity of interpreting source code from the zip file.
As usual, I wrote some sample code to illustrate how this way works, and you can browser sample code from the following site.
https://github.com/suzp1984/parrot/tree/master/python/zipexe
Comments
Post a Comment