Python Project Layout: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 4: Line 4:


A typical Python project layout, which allows for code written in other programming languages as well, is similar to:
A typical Python project layout, which allows for code written in other programming languages as well, is similar to:
<font size=-1>
.
├─ .gitignore
├─ requirements.txt
├─ src
│    └─ main
│        └─ python
└─ venv
      ├─ bin
    ...
</font>


=Setting a Manual Project=
=Setting a Manual Project=

Revision as of 00:42, 18 February 2022

Internal

Overview

A typical Python project layout, which allows for code written in other programming languages as well, is similar to:

.
├─ .gitignore
├─ requirements.txt
├─ src
│    └─ main
│         └─ python 
└─ venv
     ├─ bin
    ...

Setting a Manual Project

python3 -m venv venv
venv/bin/pip install -r requirements.txt

Example of .gitignore:

Example of requirements.txt:

datadog == 0.43.0

More details on requirements.txt

Virtual Environment

Organizatorium

  • /Users/ovidiu/Library/Python/3.8/bin/ must be in PATH.
  • Python environments on Mac:
    • ~/Library/ApplicationSupport/iTerm2/iterm2env/versions/*/bin/python3
    • ~/Library/ApplicationSupport/iTerm2/Scripts/YourScript/iterm2env/versions/*/bin/python3