diff --git a/README.md b/README.md index e911850..756b62b 100644 --- a/README.md +++ b/README.md @@ -1741,7 +1741,7 @@ shutil.rmtree(<path>) # Deletes the directory. <int> = <pipe>.close() # Returns None if last command exited with returncode 0. ``` -#### Sends '1 + 1' to the basic calculator and captures its output: +#### Sends "1 + 1" to the basic calculator and captures its output: ```python >>> subprocess.run('bc', input='1 + 1\n', capture_output=True, text=True) CompletedProcess(args='bc', returncode=0, stdout='2\n', stderr='') @@ -1910,7 +1910,7 @@ with <conn>: # Exits the block with commit() o ### Placeholders ```python <conn>.execute('<query>', <list/tuple>) # Replaces every question mark with an item. -<conn>.execute('<query>', <dict/namedtuple>) # Replaces every :<key> with value. +<conn>.execute('<query>', <dict/namedtuple>) # Replaces every :<key> with a value. <conn>.executemany('<query>', <coll_of_coll>) # Runs execute() multiple times. ``` * **Passed values can be of type str, int, float, bytes, None, or bool (stored as 1 or 0).** @@ -1999,8 +1999,8 @@ Struct ```python from struct import pack, unpack -<bytes> = pack('<format>', <num_1> [, ...]) # Packs numbers according to format string. -<tuple> = unpack('<format>', <bytes>) # Use iter_unpack() to get iterator of tuples. +<bytes> = pack('<format>', <el_1> [, ...]) # Packs numbers according to format string. +<tuple> = unpack('<format>', <bytes>) # Use iter_unpack() to get iterator of tuples. ``` ```python diff --git a/index.html b/index.html index ef71033..02786fc 100644 --- a/index.html +++ b/index.html @@ -1473,7 +1473,7 @@ shutil.rmtree(<path>) <span class="hljs-comment"># Deletes t <int> = <pipe>.close() <span class="hljs-comment"># Returns None if last command exited with returncode 0.</span> </code></pre></div> -<div><h4 id="sends11tothebasiccalculatorandcapturesitsoutput">Sends '1 + 1' to the basic calculator and captures its output:</h4><pre><code class="python language-python hljs"><span class="hljs-meta">>>> </span>subprocess.run(<span class="hljs-string">'bc'</span>, input=<span class="hljs-string">'1 + 1\n'</span>, capture_output=<span class="hljs-keyword">True</span>, text=<span class="hljs-keyword">True</span>) +<div><h4 id="sends11tothebasiccalculatorandcapturesitsoutput">Sends "1 + 1" to the basic calculator and captures its output:</h4><pre><code class="python language-python hljs"><span class="hljs-meta">>>> </span>subprocess.run(<span class="hljs-string">'bc'</span>, input=<span class="hljs-string">'1 + 1\n'</span>, capture_output=<span class="hljs-keyword">True</span>, text=<span class="hljs-keyword">True</span>) CompletedProcess(args=<span class="hljs-string">'bc'</span>, returncode=<span class="hljs-number">0</span>, stdout=<span class="hljs-string">'2\n'</span>, stderr=<span class="hljs-string">''</span>) </code></pre></div> @@ -1597,7 +1597,7 @@ CompletedProcess(args=[<span class="hljs-string">'bc'</span>, <span class="hljs- </code></pre></div> <div><h3 id="placeholders">Placeholders</h3><pre><code class="python language-python hljs"><conn>.execute(<span class="hljs-string">'<query>'</span>, <list/tuple>) <span class="hljs-comment"># Replaces every question mark with an item.</span> -<conn>.execute(<span class="hljs-string">'<query>'</span>, <dict/namedtuple>) <span class="hljs-comment"># Replaces every :<key> with value.</span> +<conn>.execute(<span class="hljs-string">'<query>'</span>, <dict/namedtuple>) <span class="hljs-comment"># Replaces every :<key> with a value.</span> <conn>.executemany(<span class="hljs-string">'<query>'</span>, <coll_of_coll>) <span class="hljs-comment"># Runs execute() multiple times.</span> </code></pre></div> @@ -1665,8 +1665,8 @@ CompletedProcess(args=[<span class="hljs-string">'bc'</span>, <span class="hljs- <li><strong>System’s type sizes, byte order, and alignment rules are used by default.</strong></li> </ul><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> struct <span class="hljs-keyword">import</span> pack, unpack -<bytes> = pack(<span class="hljs-string">'<format>'</span>, <num_1> [, ...]) <span class="hljs-comment"># Packs numbers according to format string.</span> -<tuple> = unpack(<span class="hljs-string">'<format>'</span>, <bytes>) <span class="hljs-comment"># Use iter_unpack() to get iterator of tuples.</span> +<bytes> = pack(<span class="hljs-string">'<format>'</span>, <el_1> [, ...]) <span class="hljs-comment"># Packs numbers according to format string.</span> +<tuple> = unpack(<span class="hljs-string">'<format>'</span>, <bytes>) <span class="hljs-comment"># Use iter_unpack() to get iterator of tuples.</span> </code></pre></div>