Python Learning-Project Development Catalog specification

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.