Visual Studio Code: your code editorPython 3.13Git: to manage your repositoriesPostgreSQL: a database
cloudBeaver: for viewing and editing this databasePython 3.10: Python version chosen by ENSAIVisual Studio CodeGitPostgreSQL
DBeaver: database administration tool to consult or edit.vscode/settings.json
{
"workbench.colorTheme": "Dark Modern",
"editor.fontSize": 16,
"[python]": {
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.tabSize": 4,
"editor.defaultFormatter": "charliermarsh.ruff",
},
"ruff.lint.enable": true,
"files.exclude": {
"**/__pycache__": true,
"**/.pytest_cache": true,
}
}A static analysis tool for Python that:
🚧
PROJET-INFO-2A
├── .vscode/settings.json
├── data
│ └── init_db.sql
├── doc
│ └── suivi
│ └── YYYY.MM.DD-semaineN.md
├── src
│ ├── business_object
│ │ └── une_classe.py
│ ├── dao
│ │ └── une_classe_dao.py
│ ├── service
│ │ └── une_classe_service.py
│ ├── tests
│ │ ├── dao
│ │ └── service
│ ├── utils
│ └── view
│ └── accueil_view.py
├── .gitignore
├── LICENCE
├── README.md
└── requirements.txtmathematical_operations.py
class MathematicalOperations:
"""Mathematical Operations"""
def divide_five_by(self, number) -> float:
"""Divides the number 5 by a given number.
Parameters
----------
number : float or int
The number by which 5 will be divided.
Returns
-------
float or None
The result of dividing 5 by the given number.
If the number is equal to 0, the method returns None.
"""
if number != 0:
return 5 / number
else:
return NoneNote
Logging is the process of recording events, errors, and information in an application.
A log captures information about what happened at a given time:
It is possible to externalize the configuration in a logging_config.yml file
Use the modules:
And add a @Log decorator before each method