<pre><codeclass="python language-python hljs"><Path> = <Path>.parent <spanclass="hljs-comment"># Returns Path without the final component.</span>
<str> = <Path>.name <spanclass="hljs-comment"># Returns final component as a string.</span>
<str> = <Path>.stem <spanclass="hljs-comment"># Returns final component w/o last extension.</span>
<str> = <Path>.suffix<spanclass="hljs-comment"># Returns last extension prepended with a dot.</span>
<str> = <Path>.suffix<spanclass="hljs-comment"># Returns name's last extension (e.g. '.py').</span>
<str> = <Path>.stem <spanclass="hljs-comment"># Returns name without its last extension.</span>
<tup.> = <Path>.parts <spanclass="hljs-comment"># Returns all path's components as strings.</span>
<conn>.execute(<spanclass="hljs-string">'<query>'</span>) <spanclass="hljs-comment"># depending on whether any exception occurred.</span>
</code></pre></div>
<div><h3id="placeholders">Placeholders</h3><pre><codeclass="python language-python hljs"><conn>.execute(<spanclass="hljs-string">'<query>'</span>, <list/tuple>) <spanclass="hljs-comment"># Replaces '?'s in query with values.</span>
<conn>.execute(<spanclass="hljs-string">'<query>'</span>, <dict/namedtuple>) <spanclass="hljs-comment"># Replaces ':<key>'s with values.</span>
<div><h3id="placeholders">Placeholders</h3><pre><codeclass="python language-python hljs"><conn>.execute(<spanclass="hljs-string">'<query>'</span>, <list/tuple>) <spanclass="hljs-comment"># Replaces every '?' with an item.</span>
<conn>.execute(<spanclass="hljs-string">'<query>'</span>, <dict/namedtuple>) <spanclass="hljs-comment"># Replaces every ':<key>' with a value.</span>
<bytes> = pack(<spanclass="hljs-string">'<format>'</span>, <el_1> [, ...]) <spanclass="hljs-comment"># Packs objects according to format string.</span>
<tuple> = unpack(<spanclass="hljs-string">'<format>'</span>, <bytes>) <spanclass="hljs-comment"># Use iter_unpack() to get iterator of tuples.</span>
<bytes> = pack(<spanclass="hljs-string">'<format>'</span>, <num_1> [, ...]) <spanclass="hljs-comment"># Packs numbers according to format string.</span>
<tuple> = unpack(<spanclass="hljs-string">'<format>'</span>, <bytes>) <spanclass="hljs-comment"># Use iter_unpack() to get iterator of tuples.</span>
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'kwargs=<dict>'</span></code> to pass keyword arguments to the function.</strong></li>
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'daemon=True'</span></code>, or program won't be able to exit while the thread is alive.</strong></li>
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'daemon=True'</span></code>, or the program won't be able to exit while the thread is alive.</strong></li>
</ul>
<div><h3id="lock">Lock</h3><pre><codeclass="python language-python hljs"><lock> = Lock/RLock() <spanclass="hljs-comment"># RLock can only be released by acquirer.</span>
<lock>.acquire() <spanclass="hljs-comment"># Waits for the lock to be available.</span>
<Futr> = <Exec>.submit(<func>, <arg_1>, ...) <spanclass="hljs-comment"># Creates a thread and returns its Future obj.</span>
<Exec>.shutdown() <spanclass="hljs-comment"># Blocks until all threads finish executing.</span>
<Exec>.shutdown() <spanclass="hljs-comment"># Waits for all submitted threads to finish.</span>
</code></pre></div>
<pre><codeclass="python language-python hljs"><bool> = <Future>.done() <spanclass="hljs-comment"># Checks if the thread has finished executing.</span>
@ -2940,7 +2940,7 @@ $ deactivate <span class="hljs-comment"># Deactivates the active