私の研究のためにPythonを使ってシェルコマンド "objdump"を実行したい subprocess.call("command")
を使ってlinuxコマンドを実行しましたが、Python:Pythonスクリプトを使用してシェルコマンドを実行したい
subprocess.call('date', shell=True)
実際には、シェルを使用して、グローバルにアクセスすることを許可しない:私は試してみました
サンプルコードが実行
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\subprocess.py", line 168, in call
return Popen(*popenargs, **kwargs).wait()
File "C:\Python27\lib\subprocess.py", line 390, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 640, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
私は、トレースバックがUbuntuシステムからではないと確信しています! – errikos