mirror of
https://github.com/redoules/redoules.github.io.git
synced 2025-12-13 16:19:34 +00:00
corrected makedown error
This commit is contained in:
parent
5f9f210865
commit
517100a33b
@ -129,15 +129,15 @@
|
|||||||
<p>This short article show you how to open a file using python. We will use the with keyword in order to avoid having to close the file.</p>
|
<p>This short article show you how to open a file using python. We will use the with keyword in order to avoid having to close the file.</p>
|
||||||
<p>There is no need to import anything in order to open a file. All the function related to file manipulation are part of the python standard library</p>
|
<p>There is no need to import anything in order to open a file. All the function related to file manipulation are part of the python standard library</p>
|
||||||
<p>In order to open a file, we will use the function open. This function takes two arguments :
|
<p>In order to open a file, we will use the function open. This function takes two arguments :
|
||||||
<em> the path of the file
|
- the path of the file
|
||||||
</em> the mode you want to open the file </p>
|
- the mode you want to open the file </p>
|
||||||
<p>The mode can be :
|
<p>The mode can be :
|
||||||
<em> 'r' : read
|
- 'r' : read
|
||||||
</em> 'w' : write
|
- 'w' : write
|
||||||
<em> 'a' : append (writes at the end of the file)
|
- 'a' : append (writes at the end of the file)
|
||||||
</em> 'b' : binary mode
|
- 'b' : binary mode
|
||||||
<em> 'x' : exclusive creation
|
- 'x' : exclusive creation
|
||||||
</em> 't' : text mode (by default)</p>
|
- 't' : text mode (by default)</p>
|
||||||
<p>Note that if the file does not exit it will be created if you use the following options "w", "a", "x".
|
<p>Note that if the file does not exit it will be created if you use the following options "w", "a", "x".
|
||||||
If you try to open a non existing file in read mode 'r', a FileNotFoundError will be returned.</p>
|
If you try to open a non existing file in read mode 'r', a FileNotFoundError will be returned.</p>
|
||||||
<p>It is possible to combine multiple options together. For instance, you can open a file in binary mode for writing using the 'wb' option.</p>
|
<p>It is possible to combine multiple options together. For instance, you can open a file in binary mode for writing using the 'wb' option.</p>
|
||||||
|
|||||||
@ -5,7 +5,7 @@ xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|||||||
|
|
||||||
<url>
|
<url>
|
||||||
<loc>redoules.github.io/</loc>
|
<loc>redoules.github.io/</loc>
|
||||||
<lastmod>2018-08-03T18:39:27-00:00</lastmod>
|
<lastmod>2018-08-03T18:47:07-00:00</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
<priority>0.5</priority>
|
<priority>0.5</priority>
|
||||||
</url>
|
</url>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user