나를 실행하는 html 페이지 내가 사용하는 버튼을 특정 시간을 설정(아래 참조)에는 나중에 실행 cronjob 을 통해 모듈 플라스크-crontab. 어떻게 사용할 수 있습니 minute
, hour
, day
, month
외부 def get_time()
설정하지 않고 변수 글로벌?
무슨 단단한 방법을 사용하여 플라스크-crontab 까요?
APP = Flask(__name__)
Bootstrap(APP)
crontab = Crontab(APP)
...
@APP.route('/randompage.html' methods = ['POST', 'GET])
def get_time():
time_req = request.args.get("html_time")
format_time = datetime.strptime(time_req, "%Y-%m-%dT%H:%M")
minute = format_time.minute
hour = format_time.hour
day = format_time.day
month = fomrat_time.month
return render_template('randompage.html', time_req=time_req)
@crontab.job()
def exe_control():
do something here
버튼에는 html 페이지:
<form action="/randompage.html" method="GET">
<input type="datetime-local" name="html_time"/>
<input type="submit"/></form>