Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Running shell command on Windows from Python

By: a guest on Apr 16th, 2012  |  syntax: Python  |  size: 0.13 KB  |  views: 236  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. pythoncom.CoInitialize()
  2. shell = win32com.client.Dispatch('WScript.Shell')
  3. shell.Run(command, 1, False)
  4. pythoncom.CoUninitialize()