0
/Users/admin/Desktopにscript.pyがあり、このスクリプトを/ Users/admin/Desktop/folder /現在のディレクトリを変更することなく、file.txtを返します。コマンドラインpythonスクリプトが別のディレクトリにあるファイルで実行される
質問:コマンドラインでこれを行う最も効率的な方法は何ですか?私は次のコマンドを使用しており、結果は期待通りにはありません。
$ python script.py --script; /Users/admin/Desktop/file.txt
raise StopIteration('because of missing file (file.txt)')
StopIteration: because of missing file (file.txt)
1)セミコロンはコマンドを途中で終了します。 2)コードを表示しない。 – mhawke
[コマンドを実行するために一時的に現在の作業ディレクトリをbashで変更する](http://stackoverflow.com/questions/10382141/temporarily-change-current-working-directory-in-bash-to-run-a-コマンド) –
私は2000行のコードを持っています! – user3698773