What are the benefits of the Software Catalog structure specification:
Through normalization, the software structure can be better controlled, so that the program has a higher readability.
The project directory has the following organizational structure:
foo/ # project Name
--bin/ # executable file directory
--foo # Executable Program
--core/# Main Program Directory
--test/# test Cases (for functional testing in projects)
--__init__.py
--test_main.py
--__init__.py
--main.py # Main Program entry
--conf/# configuration file directory
--settings.py #配置文件
--logs/# log file directory
--log # log file
--docs/# document class directory
--setup.py # Installing Deployment scripts
--requirements.txt #依赖关系, store the dependent package name,
--readme # Program Description
Individual instructions:
Readme Content Description
1: Software positioning, basic functions of software
2: How to run the code: Installation environment, start command and so on.
3: Brief instructions for use.
4: Code directory structure description, in more detail can explain the basic principles of software
5: FAQ's description.
Requirements.txt
The file format is a one-line description that contains a packet dependency, which requires that the format be identified by Pip and used in the following way:
Pip Install-r requirements.txt to install all dependent packages
How to dynamically import each of the above catalogue modules for dynamic migration.
Import OS
Import Sys
Base_dir = Os.path.dirname (Os.path.dirname (Os.path.abspath (__file__)))
Sys.path.append (Base_dir)
Here: by dynamically importing the current root path of the project.
Python Learning-Project Development Catalog specification