LoginSignup
7
12

More than 5 years have passed since last update.

Pythonファイルをターミナルから実行し、自動化する

Last updated at Posted at 2018-01-04

やりたいこと

  • PycharmProjects以下のファイルをターミナルから実行
  • 6時間毎に自動化

結論

以下のPythonファイルを実行したい

test.py
print "グラッチェ"
terminal
$ python test.py

結果

terminal
グラッチェ

自動化

watchコマンドを使用して、秒数を6H = 60 * 60 * 60 * 6 = 1296000sに設定

terminal
$ watch -n 1296000 "python test.py"
7
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
12