|
|
@ -1095,8 +1095,8 @@ Z = dataclasses.make_dataclass(<span class="hljs-string">'Z'</span>, [<span clas |
|
|
|
<span class="hljs-meta">... </span> print(file.read()) |
|
|
|
Hello World! |
|
|
|
</code></pre> |
|
|
|
<div><h4 id="listofexistingcontextmanagers">List of existing context managers:</h4><pre><code class="python language-python hljs"><span class="hljs-keyword">with</span> open(<span class="hljs-string">'<path>'</span>, ...) <span class="hljs-keyword">as</span> file: ... |
|
|
|
<span class="hljs-keyword">with</span> wave.open(<span class="hljs-string">'<path>'</span>, ...) <span class="hljs-keyword">as</span> wave_file: ... |
|
|
|
<div><h4 id="listofexistingcontextmanagers">List of existing context managers:</h4><pre><code class="python language-python hljs"><span class="hljs-keyword">with</span> open(<span class="hljs-string">'<path>'</span>) <span class="hljs-keyword">as</span> file: ... |
|
|
|
<span class="hljs-keyword">with</span> wave.open(<span class="hljs-string">'<path>'</span>) <span class="hljs-keyword">as</span> wave_file: ... |
|
|
|
<span class="hljs-keyword">with</span> memoryview(<bytes/bytearray/array>) <span class="hljs-keyword">as</span> view: ... |
|
|
|
db = sqlite3.connect(<span class="hljs-string">'<path>'</span>); <span class="hljs-keyword">with</span> db: db.execute(<span class="hljs-string">'<insert_query>'</span>) |
|
|
|
lock = threading.RLock(); <span class="hljs-keyword">with</span> lock: ... |
|
|
|