1
0
Bifurcation 0
miroir de https://github.com/PAPAMICA/Wiki-Tech.io.git synchronisé 2024-07-05 09:30:22 +02:00

docs: update Scripting/Python/Manip-donnees

Cette révision appartient à :
Maxime Mourier 2021-06-08 10:24:19 +00:00 révisé par Mickael Asseline
Parent b9febe4d0c
révision ac799a28be

Voir le fichier

@ -2,7 +2,7 @@
title: Python - Manipulation des données
description:
published: true
date: 2021-06-08T10:02:21.639Z
date: 2021-06-08T10:24:17.579Z
tags:
editor: ckeditor
dateCreated: 2021-06-07T08:01:47.026Z
@ -170,9 +170,13 @@ file.close()</code></pre>
<p>Une méthode plus fiable, plus sécurisée sera donc d'utiliser <i>open() </i>avec <i>with. </i>Le fichier sera automatiquement fermé.</p>
<pre><code class="language-python">with open('test.txt','r') as file:
[...]</code></pre>
<p>&nbsp;</p>
<blockquote>
<p><i><strong>Attention : </strong>On voit les deux points à la fin de la ligne. Cela implique donc d'<strong>indenter</strong> les lignes suivantes.</i></p>
</blockquote>
<blockquote>
<p><strong>Info : </strong>Pour donner le chemin vers le fichier il faut des “ / “ et non des ” \ ". Ex : C:/mon<i>dossier/mon</i>fichier</p>
</blockquote>
<h2>Fichier texte</h2>
<h2>Fichier CSV</h2>
<p>&nbsp;</p>