SHARE
TWEET

Running shell command on Windows from Python

a guest Apr 16th, 2012 343 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pythoncom.CoInitialize()
  2. shell = win32com.client.Dispatch('WScript.Shell')
  3. shell.Run(command, 1, False)
  4. pythoncom.CoUninitialize()
RAW Paste Data
Want to get better at Python?
Learn to code Python in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top