title: Python Subprocess Class
body: <p>I am a learning Python and was trying the subprocess class from the tutorial. The tutorial uses MAC OS hence used <strong>ls -l</strong> . Since i am using Windows OS i used <strong>dir -d</strong> instead. </p>
  
  <p><code>import subprocess
  subprocess.run(["dir", "-d"])</code></p>
  
  <p><strong>When ran the code in the terminal it prompts</strong></p>
  
  <pre><code> C:\Users\Farhan Hasant\Desktop\HelloWorld&gt;dir -d
   Volume in drive C has no label.
   Volume Serial Number is 8296-8904
   Directory of C:\Users\Farhan Hasant\Desktop\HelloWorld
   File Not Found
  </code></pre>
  
  <p><strong>Again, when i ran the code using code runner in VS code it shows</strong></p>
  
  <pre><code>[Running] python -u "c:\Users\Farhan Hasant\Desktop\HelloWorld\app.py"
  Traceback (most recent call last):
  File "c:\Users\Farhan Hasant\Desktop\HelloWorld\app.py", line 3, in &lt;module&gt;
  subprocess.run(["dir", "-d"])
  File "C:\Users\Farhan Hasant\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 472, in run
  with Popen(*popenargs, **kwargs) as process:
  File "C:\Users\Farhan Hasant\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 775, in init
  restore_signals, start_new_session)
  File "C:\Users\Farhan Hasant\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1178, in _execute_child
  startupinfo)[![enter image description here][1]][1]
  FileNotFoundError: [WinError 2] The system cannot find the file specified
  [Done] exited with code=1 in 0.213 seconds
  </code></pre>
  
  <p><strong>My files</strong> <a href="https://i.stack.imgur.com/4knuL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4knuL.png" alt="enter image description here"></a></p>
  
  <p>I am confused if I am doing it right. I would really appreciate your input on this. Thank you in advance. </p>