-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
41 lines (34 loc) · 905 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import logging
# from apscheduler.schedulers.blocking import BlockingScheduler
import time
from utils.mufg import mufg_balance
from utils.smbc import smbc_balance
from utils.sqlitedb import sql
logging.getLogger().setLevel(logging.INFO)
logging.basicConfig(
format="[%(levelname)s] %(asctime)s: %(message)s",
handlers=[
logging.FileHandler("data/run.log", encoding="UTF-8"),
logging.StreamHandler(),
],
)
def balance_inquiry():
smbc_balance()
mufg_balance()
def main():
sql.create_db()
while True:
balance_inquiry()
time.sleep(60)
# scheduler = BlockingScheduler(timezone="Asia/Tokyo")
# scheduler.add_job(
# func=balance_inquiry,
# trigger="interval",
# minutes=1
# )
# scheduler.start()
if __name__ == "__main__":
try:
main()
except (KeyboardInterrupt, SystemExit):
exit()