2017-05-28 Python 3 からシェル(bash)のコマンドを実行する Python Python3 のソース内でbashコマンド(ls -shal)を実行する。 実行結果 Python3 の注意点 ・import commands は動作しない Python2までしか使えない。Python3 では廃止された。代わりに import subprocess を使う。 ・print文の引数にはカッコをつける print ("必ずカッコをつける") print ("文字列にはダブルクオートをつける") print ('シングルクオートでもよい')