Python's Software directory structure specification

Source: Internet
Author: User

Directory structure Specification-Stackoverflow.com-project structure

Suggested patterns

Assuming that your project is named Foo, I would recommend the most convenient and quick directory structure that would suffice:

foo/
|--bin/
| |--foo (main program directory, startup script, call main)
|
|--foo/
| |--tests/
|   | |--__init__.py
|   | |--test_main.py
| |
| |--__init__.py (with this file is called package)
| |--main.py (main entrance of the program)
|
|--docs/
| |--conf.py
| |--Abc.rst
|
|--setup.py
|--Requirements.txt
|--README

Briefly explain:

      1. Bin/: To store some executable files of the project, of course you can name script/and so on.
      2. foo/: Stores all source code for the project. (1) All modules and packages in the source code should be placed in this directory. Do not place the top level directory. (2) Its subdirectory tests/storage unit test code; (3) The entrance of the program is preferably named main.py.
      3. Docs/: Store some documents.
      4. setup.py: Scripts to install, deploy, and package.
      5. Requirements.txt: A list of external Python packages that store software dependencies.
      6. README: project documentation.

Python's Software directory structure specification

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.