Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente | |||
| python:filesystem [2023/06/26 16:58] – [Manipulation sur les chemins] fix typo phsw | python:filesystem [2024/03/27 10:23] (Version actuelle) – add how to create temporary file phsw | ||
|---|---|---|---|
| Ligne 141: | Ligne 141: | ||
| print(os.path.splitext("/ | print(os.path.splitext("/ | ||
| </ | </ | ||
| + | |||
| + | |||
| + | ==== Fichiers temporaires ==== | ||
| + | |||
| + | Utilise l' | ||
| + | <code python> | ||
| + | from tempfile import NamedTemporaryFile | ||
| + | |||
| + | f = NamedTemporaryFile(mode=" | ||
| + | f.write(" | ||
| + | f.close() | ||
| + | print(f" | ||
| + | </ | ||
| + | |||