script execution
デバックが終わった後に長いscriptを流す際には
nice -n 10 python -i hoge.py
最初のnice -n 10は,プロセスの優先度をデフォルトの0から10に下げて,他の小さいプロセスが重くならないようにする配慮.
python -i hoge.py
# -i をつけることで,スクリプト実行後にそのスクリプトで定義した変数を参照できる.
# debugには絶対こっち
私が通常行っている実行方法は,
デバック時は
python -i hoge.py で実行して,エラーで止まったら変数をチェックして,必要な修正を別ウインドウで実行しているエディタで修正して保存,Ctrl+d,↑キーでpython -i hoge.pyを再実行,...をエラーがなくなるまで繰り返す.
python -i hoge.py
# with -i you can use variables that defined by the script.
# This is very important when we debug.
I usually excute python script using this -i option. More specifically,
When I debug, I run python -i hoge.py, and check variables after the execution stops, correct the script using an editor on another window, and re-run the script by Ctrl+d, ↑. Repeat this process until bugs are cleared.
When I run a heavy script after the debug, I use
nice -n 10 python -i hoge.py
The first "nice -n 10" means that the priority of this execution is lower than that default 0. This is to reduce burden for small processes.