title: How execute powershell or command-prompt script and print output in python
body: <p>I'm trying to run and print mypowershell script from python
  Or run cmd command and print result in python
  2 file is in directory "C:\workspace\test" --> program.ps1 And program.py</p>
  
  <p>powershell script --> program.ps1 :</p>
  
  <pre><code>Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize
  </code></pre>
  
  <p>cmd command:</p>
  
  <pre><code>powershell -noexit "&amp; ""C:\workspace\test\program.ps1"""
  </code></pre>
  
  <p>both commands print installed programs in windows
  how i can run one of the two command in python?
  ه'm grateful you give an example</p>