Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

access cmd with python

>>> import subprocess
>>> proc = subprocess.Popen('cmd.exe', stdin = subprocess.PIPE, stdout = subprocess.PIPE)
>>> stdout, stderr = proc.communicate('dir c:')
>>> stdout
'Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporatio
n.  All rights reserved.

C:Python25>More? '
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #access #cmd #python
ADD COMMENT
Topic
Name
6+6 =