Skip to content

Commit 0f03468

Browse files
committed
OS commands, csv
1 parent b79d178 commit 0f03468

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,7 +1702,7 @@ import os
17021702
CompletedProcess(args='bc', returncode=0, stdout='2\n', stderr='')
17031703
```
17041704

1705-
#### Sends 'test.in' to the calculator running in standard mode and saves its output to 'test.out':
1705+
#### Sends test.in to the calculator running in standard mode and saves its output to test.out:
17061706
```python
17071707
>>> from shlex import split
17081708
>>> os.popen('echo 1 + 1 > test.in')
@@ -1785,7 +1785,7 @@ import csv
17851785
<writer>.writerow(<collection>) # Encodes objects using `str(<el>)`.
17861786
<writer>.writerows(<coll_of_coll>) # Appends multiple rows.
17871787
```
1788-
* **File must be opened with `'newline=""'` argument, or an extra '\r' will be added on platforms that use '\r\n' linendings!**
1788+
* **File must be opened with `'newline=""'` argument, or an extra '\r' will be added to every '\n' on platforms that use '\r\n' linendings!**
17891789

17901790
### Parameters
17911791
* **`'dialect'` - Master parameter that sets the default values.**

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@
15411541
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>)
15421542
</code></pre></div>
15431543

1544-
<div><h4 id="sendstestintothecalculatorrunninginstandardmodeandsavesitsoutputtotestout">Sends 'test.in' to the calculator running in standard mode and saves its output to 'test.out':</h4><pre><code class="python language-python hljs"><span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> shlex <span class="hljs-keyword">import</span> split
1544+
<div><h4 id="sendstestintothecalculatorrunninginstandardmodeandsavesitsoutputtotestout">Sends test.in to the calculator running in standard mode and saves its output to test.out:</h4><pre><code class="python language-python hljs"><span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> shlex <span class="hljs-keyword">import</span> split
15451545
<span class="hljs-meta">&gt;&gt;&gt; </span>os.popen(<span class="hljs-string">'echo 1 + 1 &gt; test.in'</span>)
15461546
<span class="hljs-meta">&gt;&gt;&gt; </span>run(split(<span class="hljs-string">'bc -s'</span>), stdin=open(<span class="hljs-string">'test.in'</span>), stdout=open(<span class="hljs-string">'test.out'</span>, <span class="hljs-string">'w'</span>))
15471547
CompletedProcess(args=[<span class="hljs-string">'bc'</span>, <span class="hljs-string">'-s'</span>], returncode=<span class="hljs-number">0</span>)
@@ -1599,7 +1599,7 @@
15991599
</code></pre></div>
16001600

16011601
<ul>
1602-
<li><strong>File must be opened with <code class="python hljs"><span class="hljs-string">'newline=""'</span></code> argument, or an extra '\r' will be added on platforms that use '\r\n' linendings!</strong></li>
1602+
<li><strong>File must be opened with <code class="python hljs"><span class="hljs-string">'newline=""'</span></code> argument, or an extra '\r' will be added to every '\n' on platforms that use '\r\n' linendings!</strong></li>
16031603
</ul>
16041604
<div><h3 id="parameters">Parameters</h3><ul>
16051605
<li><strong><code class="python hljs"><span class="hljs-string">'dialect'</span></code> - Master parameter that sets the default values.</strong></li>

0 commit comments

Comments
 (0)