@ -1307,7 +1307,7 @@ value = args.<name>
< li > < strong > Use < code class = "python hljs" > < span class = "hljs-string" > 'type=FileType(< mode> )'< / span > < / code > for files.< / strong > < / li >
< li > < strong > Use < code class = "python hljs" > < span class = "hljs-string" > 'type=FileType(< mode> )'< / span > < / code > for files.< / strong > < / li >
< / ul >
< / ul >
< h2 id = "open" > < a href = "#open" name = "open" > #< / a > Open< / h2 >
< h2 id = "open" > < a href = "#open" name = "open" > #< / a > Open< / h2 >
< p > < strong > Opens a file and returns a corresponding file object or raises 'FileNotFoundError' .< / strong > < / p >
< p > < strong > Opens a file and returns a corresponding file object.< / strong > < / p >
< pre > < code class = "python language-python hljs" > < file> = open(< span class = "hljs-string" > '< path> '< / span > , mode=< span class = "hljs-string" > 'r'< / span > , encoding=< span class = "hljs-keyword" > None< / span > , newline=< span class = "hljs-keyword" > None< / span > )
< pre > < code class = "python language-python hljs" > < file> = open(< span class = "hljs-string" > '< path> '< / span > , mode=< span class = "hljs-string" > 'r'< / span > , encoding=< span class = "hljs-keyword" > None< / span > , newline=< span class = "hljs-keyword" > None< / span > )
< / code > < / pre >
< / code > < / pre >
< ul >
< ul >
@ -1327,6 +1327,11 @@ value = args.<name>
< li > < strong > < code class = "python hljs" > < span class = "hljs-string" > 't'< / span > < / code > - Text mode (default).< / strong > < / li >
< li > < strong > < code class = "python hljs" > < span class = "hljs-string" > 't'< / span > < / code > - Text mode (default).< / strong > < / li >
< li > < strong > < code class = "python hljs" > < span class = "hljs-string" > 'b'< / span > < / code > - Binary mode.< / strong > < / li >
< li > < strong > < code class = "python hljs" > < span class = "hljs-string" > 'b'< / span > < / code > - Binary mode.< / strong > < / li >
< / ul >
< / ul >
< h3 id = "exceptions-1" > Exceptions< / h3 >
< ul >
< li > < strong > < code class = "python hljs" > < span class = "hljs-string" > 'FileNotFoundError'< / span > < / code > can be risen when reading with < code class = "python hljs" > < span class = "hljs-string" > 'r'< / span > < / code > or < code class = "python hljs" > < span class = "hljs-string" > 'r+'< / span > < / code > .< / strong > < / li >
< li > < strong > < code class = "python hljs" > < span class = "hljs-string" > 'FileExistsError'< / span > < / code > can be risen when writing with < code class = "python hljs" > < span class = "hljs-string" > 'x'< / span > < / code > .< / strong > < / li >
< / ul >
< h3 id = "file" > File< / h3 >
< h3 id = "file" > File< / h3 >
< pre > < code class = "python language-python hljs" > < file> .seek(< span class = "hljs-number" > 0< / span > ) < span class = "hljs-comment" > # Moves to the start of the file.< / span >
< pre > < code class = "python language-python hljs" > < file> .seek(< span class = "hljs-number" > 0< / span > ) < span class = "hljs-comment" > # Moves to the start of the file.< / span >
< file> .seek(offset) < span class = "hljs-comment" > # Moves 'offset' chars/bytes from the start.< / span >
< file> .seek(offset) < span class = "hljs-comment" > # Moves 'offset' chars/bytes from the start.< / span >
@ -1809,7 +1814,7 @@ logger.<level>(<span class="hljs-string">'A logging message.'</span>)
< ul >
< ul >
< li > < strong > Levels: < code class = "python hljs" > < span class = "hljs-string" > 'debug'< / span > < / code > , < code class = "python hljs" > < span class = "hljs-string" > 'info'< / span > < / code > , < code class = "python hljs" > < span class = "hljs-string" > 'success'< / span > < / code > , < code class = "python hljs" > < span class = "hljs-string" > 'warning'< / span > < / code > , < code class = "python hljs" > < span class = "hljs-string" > 'error'< / span > < / code > , < code class = "python hljs" > < span class = "hljs-string" > 'critical'< / span > < / code > .< / strong > < / li >
< li > < strong > Levels: < code class = "python hljs" > < span class = "hljs-string" > 'debug'< / span > < / code > , < code class = "python hljs" > < span class = "hljs-string" > 'info'< / span > < / code > , < code class = "python hljs" > < span class = "hljs-string" > 'success'< / span > < / code > , < code class = "python hljs" > < span class = "hljs-string" > 'warning'< / span > < / code > , < code class = "python hljs" > < span class = "hljs-string" > 'error'< / span > < / code > , < code class = "python hljs" > < span class = "hljs-string" > 'critical'< / span > < / code > .< / strong > < / li >
< / ul >
< / ul >
< h3 id = "exceptions-1 " > Exceptions< / h3 >
< h3 id = "exceptions-2 " > Exceptions< / h3 >
< p > < strong > Error description, stack trace and values of variables are appended automatically.< / strong > < / p >
< p > < strong > Error description, stack trace and values of variables are appended automatically.< / strong > < / p >
< pre > < code class = "python language-python hljs" > < span class = "hljs-keyword" > try< / span > :
< pre > < code class = "python language-python hljs" > < span class = "hljs-keyword" > try< / span > :
...
...