python
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| python [2024-07-28 09:31:23] – david | python [2024-07-28 10:02:24] (aktuell) – [venv] david | ||
|---|---|---|---|
| Zeile 18: | Zeile 18: | ||
| relevante python pakete in debian | relevante python pakete in debian | ||
| + | |||
| <code bash> | <code bash> | ||
| sudo apt install python-is-python3 python3 python3-pip python3-venv pipx | sudo apt install python-is-python3 python3 python3-pip python3-venv pipx | ||
| Zeile 24: | Zeile 25: | ||
| paket mit pipx installieren | paket mit pipx installieren | ||
| (black ist übrigens ein super python formatter, es ist sowas wie das gofmt von python) | (black ist übrigens ein super python formatter, es ist sowas wie das gofmt von python) | ||
| + | |||
| <code bash> | <code bash> | ||
| pipx install black | pipx install black | ||
| Zeile 29: | Zeile 31: | ||
| venv erstellen | venv erstellen | ||
| + | |||
| <code bash> | <code bash> | ||
| mkdir / | mkdir / | ||
| Zeile 35: | Zeile 38: | ||
| type python | type python | ||
| - | python -m venv venv | + | python -m venv .venv |
| - | . venv/ | + | . .venv/ |
| type python | type python | ||
| Zeile 47: | Zeile 50: | ||
| type python | type python | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== best practices ===== | ||
| + | |||
| + | sicherstellen, | ||
| + | |||
| + | <code python main.py> | ||
| + | # | ||
| + | |||
| + | def main(): | ||
| + | print(" | ||
| + | |||
| + | if __name__ == " | ||
| + | main() | ||
| </ | </ | ||
/home/http/wiki/data/attic/python.1722159083.txt · Zuletzt geändert: von david
