notebook/IT/python/index.md

25 lines
655 B
Markdown
Raw Permalink Normal View History

2020-11-26 17:38:25 +00:00
# python
## référence
https://github.com/gto76/python-cheatsheet/blob/master/README.md
2021-01-21 18:18:36 +00:00
Afficher les warning:```python -Wd```
Mode développement :`-X dev`
</details>
</details>`
2020-11-26 17:38:25 +00:00
## Virtual env
- create virtual env: `python3 -m venv /path`
- enter in virtual env: `source env/bin/activate`
- leave venv: `deactivate`
- list all installed package in file: `pip freeze > requirement.txt`
- install package list in file: `pip install -r requirement.txt`
## tips
- pprint permet d afficher vos structure de données
- la fonction dir() permet de lister les attribut d un
2021-01-06 19:22:00 +00:00
## unitest
### lancer une suite de tests
2021-01-21 18:18:36 +00:00
```python -m unittest tests.suite```