How to execute two cmd commands in the same instance of cmd using python
<p>Whenever I try to do</p>

<pre><code>os.system("net view /all")
</code></pre>

<p>with python, the code gets executed, but it instantly closes, so I can't read the output. I looked around a bit, and found that you can use</p>

<pre><code>ping 127.0.0.1 -n 6 &gt; nul
</code></pre>

<p>to do something like</p>

<pre><code>time.sleep()
</code></pre>

<p>in python, but if I do</p>

<pre><code>os.system("net view /all")
os.system("ping 127.0.0.1 -n 6 &gt; nul")
</code></pre>

<p>They are executed in different instances of cmd, one after the other, so the problem remains. How would I make them be run in the same instance, or how would I be able to put a delay after</p>

<p><code>net view /all</code></p>

<p>so that I can read the output? (Only solutions using stock python libs please)</p>