Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff452cc

Browse files
committed
Shell commands
1 parent 98f1cf8 commit ff452cc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,7 @@ CompletedProcess(args='bc', returncode=0, stdout='2\n', stderr='')
16901690
>>> os.popen('echo 1 + 1 > test.in')
16911691
>>> run(split('bc -s'), stdin=open('test.in'), stdout=open('test.out', 'w'))
16921692
CompletedProcess(args=['bc', '-s'], returncode=0)
1693-
>>> os.popen('cat test.out').read()
1693+
>>> open('test.out').read()
16941694
'2\n'
16951695
```
16961696

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@
15311531
<span class="hljs-meta">&gt;&gt;&gt; </span>os.popen(<span class="hljs-string">'echo 1 + 1 &gt; test.in'</span>)
15321532
<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>))
15331533
CompletedProcess(args=[<span class="hljs-string">'bc'</span>, <span class="hljs-string">'-s'</span>], returncode=<span class="hljs-number">0</span>)
1534-
<span class="hljs-meta">&gt;&gt;&gt; </span>os.popen(<span class="hljs-string">'cat test.out'</span>).read()
1534+
<span class="hljs-meta">&gt;&gt;&gt; </span>open(<span class="hljs-string">'test.out'</span>).read()
15351535
<span class="hljs-string">'2\n'</span>
15361536
</code></pre></div>
15371537

0 commit comments

Comments
 (0)