分发适用于 Linux 的 Python 软件
我正在用 Python 为 Ubuntu(或基于 Debian 的 Linux)编写我的第一个软件。我正在寻找有关分发我的软件的最佳方式的好建议。
我目前能想到的最简单的替代方案是将 python 代码存档到 *.tar.gz 中,并让用户将主 python 脚本作为可执行文件执行以运行该软件。我意识到这可能不是最好的方法。
我查看了 Debian 维护者指南:“http://www.debian.org/doc/maint-guide/ch-dother.en.html”,听起来不太懒,但该指南对于初学者来说看起来非常令人生畏。还有其他教程可以展示如何为初学者创建 debian 软件包吗?
如果有人有建议请告诉我。谢谢^_^
I am writing my first software in Python for Ubuntu (or Debian based Linux). I am looking for a good advise on the best way to distribute my software.
The easist alternative that I can think of at the moment is to archive the python code into *.tar.gz, and let user execute the main python script as an executable to run the software. I realize that this may not be the best approach.
I looked at the Debian maintainer guide: "http://www.debian.org/doc/maint-guide/ch-dother.en.html", not too sound lazy, but the guide looks very intimidating for a beginner. Are there any other tutorial that show how to create a debian package for a beginner ?
If anyone has a suggestion do let me know. Thanks ^_^
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需将源代码以 tarball 的形式发送给他们就可以了。您也可以将其放在 http://pypi.python.org/pypi 上。你还怎么想?有很多方法可以真正做到这一点。分发源代码可能是最简单的。
Just sending them the source in a tarball is perfectly fine. You could also put it up on http://pypi.python.org/pypi. How else were you thinking? There are lots of ways of doing it really. Jut distributing source is probably the easiest.
这里。这是打包和分发 Python 程序的官方的、与发行版无关的方式。 使用这个,无论如何,有一天你必须学会它。
相反,这里有一个廉价而肮脏的黑客:
/programname/
;/program/
中;programname.sh
放入/programname/
文件夹中;programname.sh
调用您的 python 文件。如果您想继续使用非标准路径,您可能会:
/usr/bin
中创建一个名为 programname 的 shell 脚本,该脚本执行python /path/to/_main_.py
Here. This is the official, distribution-agnostic way to package and distribute a python program. Use this one, you'll have to learn it anyway one day.
Here, instead, is a cheap and dirty hack:
/programname/
;/program/
;programname.sh
in your/programname/
folder;programname.sh
call your python files.If you want to go on on the non-standard path, you might:
/usr/bin
called programname, which executespython /path/to/_main_.py