Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
だから私はいくつかのファイルでいくつかのpythonスクリプトを実行しました
ls * | xargs python myscript.py
プロセスが正常に終了した後、私はプロセスを見ました
ps aux
プロセスがまだリストにあることがわかりました。手動で殺さなければなりません。どうしてこれなの?これが私のpythonスクリプトです。
import sys filex = open(argv[1]) for line in filex: do sth here.
投稿でスキップしていない限り、後でファイルに対して close() を呼び出していませんか?
最後に filex.close() を呼び出すか、代わりに「with」を使用してみてください。
with open(argv[1]) as filex: for line in filex: #do the things