Linux環境でPython3にてコマンド実行をさせようとしました。
しかし、FileNotFoundError とエラーが出てしまいました。
subprocess.callの実行ファイルはdir内です。
pthon
1subprocess.call('pwd') 2>> /pass/to/dir
PATHは問題無いはずです。
次にdirファイルにtest.txtを作成しcatで表示させようと考えました。
python
1subprocess.call('cat test.txt') 2subprocess.call('cat /pass/to/dir/test.txt') 3>> FileNotFoundError: [Errno 2] No such file or directory: 'cat test.txt'
絶対パスであろうと相対パスであろうとエラーがでますが理由がわかりません。
原因がわかる方がおられましたら解答をお願いいたします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。