将Python应用程序作为rpm/deb软件包安装到系统时,如何构建python应用程序的最佳实践是什么? 应用程序代码主要是用Python编写的,并且有一些shell脚本,配置文件和日志文件。Python应用程序目录结构(Linux)
我在想如下的结构。
- 何处放Python包?
- 我需要配置应用程序的配置文件,但它会被Python包使用。在哪里把配置文件?
/opt/.../app_name-1.0.0/
bin/ /*Here would be few shell scripts I need*/ shell_script_1.sh shell_script_2.sh var/ log/ /* Log files */ app_name.log notifications/ /* notifications, generated by app, temporarily kept */ alert_1.tmp alert_2.tmp etc/ /*python package configuration*/ /*is it better to put this in package dir?*/ app_name.config app_name/ /*Python package, the main content*/ __init__.py app_name.py a.py b.py config_file_reader.py subpackage_1/ __init__.py c.py subpackage_2/ __init__.py d.py
是的,这也可以,我猜。 – user921176