2019年5月30日 星期四

[python]flask 練習


不錯的文張:

https://hackmd.io/s/H1CMTVheG

https://cutejaneii.wordpress.com/2017/11/06/python-2-%E4%BD%BF%E7%94%A8pythonflask%E6%92%B0%E5%AF%ABapi/







How to get data received in Flask request
jinja2.exceptions.TemplateNotFound: bootstrap/base.html
https://stackoverflow.com/questions/44318142/jinja2-exceptions-templatenotfound-bootstrap-base-html


Flask學習筆記-Flask模板整合Bootstraphttps://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/13232/

2019年5月29日 星期三

[python]timer


練習:

from threading import Timer
import time
def tick_run():
    print("timer wakeup")
class RepeatingTimer(Timer):
    def run(self):
        while not self.finished.is_set():
            self.function(*self.args,**self.kwargs)
            self.finished.wait(self.interval)
t=RepeatingTimer(5.0,tick_run)
t.start()
while True:
    time.sleep(1)
    print("main wakeup")





不錯的文章:
https://www.twblogs.net/a/5c894d8ebd9eee35fc148ca6