2014年5月22日木曜日

Pythonでsudoコマンドを使う

PythonからのUnixコマンドの使い方
http://www.cyberciti.biz/faq/python-execute-unix-linux-command-examples/


sudoで実行したい場合の書き方
http://stackoverflow.com/questions/13045593/using-sudo-with-python-script
(下の方にあるos.popen().write()が正解)

こちらにも同じ正解が(真ん中あたりに)
http://ubuntuforums.org/showthread.php?t=943664