python project structure, log python project directory structure

Tip: After the article is written, the table of contents can be automatically generated. For how to generate it, please refer to the help document on the right.

Article directory

  • 1. Benefits of standardizing directory structure
  • 2. Directory organization form
  • 3. Explanation of directory structure
  • 4. About the contents of the README file
  • 5. setup.py file
  • Summarize
      • About Python technical reserves
        • 1. Learning routes in all directions of Python
        • 2. Python basic learning video
        • 3. Excellent Python learning books
      • 4. Python toolkit + project source code collection
        • ①Python toolkit
        • ②Python practical case
        • ③Python mini game source code
        • 5. Interview materials
      • 6. Python part-time channels

1. Benefits of standardizing directory structure

1. High readability: People who are not familiar with the code of this project can understand the directory structure at a glance and know which program startup script is, where is the test directory, where is the configuration file, etc. So you can understand this project very quickly.

2. High maintainability: After defining the organizational rules, the maintainer can clearly know which new files and codes should be placed in which directory. As time goes by and the size of the code increases, the project structure is not cluttered and can still be well organized.

2. Directory organization form

Project name
|-- bin
| |-- startup script.py
|
|-- project name
| |-- tests
| | |-- __init__.py
| | |-- test_main.py
| |
| |-- __init__.py
| |-- main.py
|
|- conf
|- logs
|-- docs
| |-- conf.py
| |-- abc.rst
|
|-- setup.py
|-- requirements.txt
|-- README

3. Directory structure explanation

  1. bin: Store some executable files of the project. Of course, you can name it script/ or something like that.
  2. Project name: Stores all source code of the project. (1) All modules and packages in the source code should be placed in this directory. (2) Its subdirectory tests/ stores unit test code; (3) The main entrance of the program is named main.py, and main.py is called from the bin startup script.
  3. docs: Store some documents.
  4. setup.py: Installation, deployment, and packaging scripts.
  5. requirements.txt: List of external Python packages that store software dependencies.
  6. README: Project description file.
  7. config: project configuration file
  8. logs: log files

4. About the contents of the README file

Refer to the README writing method of the redis project

  1. Software positioning, basic functions of the software.
  2. Methods of running code: installation environment, startup commands, etc.
  3. Brief instructions for use.
  4. Code directory structure description, more detailed explanation of the basic principles of the software.
  5. Frequently Asked Questions.

5. setup.py file

A project must have an installation and deployment tool that can quickly and easily install the environment, deploy the code, and run the program on a new machine. Manual deployment will encounter the following problems::

  1. When installing the environment, I often forget to add a new Python package recently. As a result, the program will go wrong as soon as it is run online.
  2. The issue of version dependency of Python packages. Sometimes we use one version of the Python package in our program, but the official one is already the latest package. The wrong version may be installed through manual installation.
  3. If there are many dependent packages, it will be time-consuming to install these dependencies one by one.
  4. When new students start writing projects, it is very troublesome to run the program because they may often forget how to install various dependencies.

Summary

In a simple project: bin, project name (source code), conf, logs, these directories are necessary, README, main.py, project name.py (startup script), these three files are necessary.

About Python technical reserves

Learning Python well is good whether you are getting a job or doing a side job to make money, but you still need to have a learning plan to learn Python. Finally, we share a complete set of Python learning materials to give some help to those who want to learn Python!

CSDN gift package: “Python introductory information & amp; practical source code & amp; installation tools] free of charge (Safe link, click with confidence)

1. Learning routes in all directions of Python

The technical points in all directions of Python are organized to form a summary of knowledge points in various fields. Its usefulness is that you can find corresponding learning resources according to the above knowledge points to ensure that you learn more comprehensively.

2. Python basic learning video

② Route corresponding learning video

There are also many learning videos suitable for beginners. With these videos, you can easily get started with Python ~ Insert picture description here

③Practice questions

After each video lesson, there are corresponding exercises to test your learning results haha!

Due to limited space, only part of the information is shown

3. High-quality Python learning books

When I learn a certain basic and have my own understanding ability, I will read some books or handwritten notes compiled by my seniors. These notes record their understanding of some technical points in detail. These understandings are relatively unique and can be learned. to a different way of thinking.

4. Python toolkit + project source code collection

①Python toolkit

The commonly used development software for learning Python is here! Each one has a detailed installation tutorial to ensure you can install it successfully!

②Python practical case

Optical theory is useless. You must learn to type code along with it and practice it in order to apply what you have learned into practice. At this time, you can learn from some practical cases. 100+ practical case source codes are waiting for you!

③Python mini game source code

If you feel that the practical cases above are a bit boring, you can try writing your own mini-game in Python to add a little fun to your learning process!

5. Interview materials

We must learn Python to find a high-paying job. The following interview questions are the latest interview materials from first-tier Internet companies such as Alibaba, Tencent, Byte, etc., and Alibaba bosses have given authoritative answers. After finishing this set I believe everyone can find a satisfactory job based on the interview information.

6. Python part-time channels

Moreover, after learning Python, you can also take orders and make money on major part-time platforms. I have compiled various part-time channels + part-time precautions + how to communicate with customers into documents.


This complete version of the complete set of Python learning materials has been uploaded to CSDN. If you need it, friends can scan the CSDN official certification QR code below on WeChat to get it for free [Guaranteed 100% Free]