title: Python os.system or subprocess.run keep output state
body: <p>When I use <code>os.system()</code> or <code>subprocess.run()</code> with commands I want to run in the brackets, it runs it like typing the command in a command prompt or terminal. </p>
  
  <p>But for example I were to do <code>cd &lt;my directory&gt;</code> to change my directory, and then afterwards I do a <code>cd</code> to display the current directory of the terminal, it would just always go back to the default directory. </p>
  
  <p>Like I started on <strong>C:\Users\MYNAME</strong>, and I were to do a <code>cd Desktop</code> to go change directory to desktop, I expect it to change directory to <strong>C:\Users\MYNAME\Desktop</strong>, which it does in that instance, but when I use the command again, it would bring me back to <strong>C:\Users\MYNAME</strong></p>
  
  <p>I want it to be able to keep the shell being sort of "active", so when I use my python program to run cmd scripts, it would continue from the last instance, instead of like starting a new one.</p>
  
  <p>(SORRY THIS IS MY FIRST TIME USING STACKOVERFLOW, I DON'T REALLY KNOW HOW TO TYPE THINGS HERE :D:D:D)</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import os, subprocess
  while True:
      try:
          try:
              subprocess.run(usr_input, shell= True) # Or os.system(usr_input)
          except Exception as e:
              print(f'error:{e}')
  
          usr_input = input('INPUT:')
      except Exception as e:
          print(e)
  </code></pre>