test.py 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. __title__ = '测试类'
  5. @Time : 2020/9/24 19:44
  6. @Author : Kenny-PC
  7. @Software: PyCharm
  8. # code is far away from bugs with the god animal protecting
  9. I love animals. They taste delicious.
  10. ┏┓ ┏┓
  11. ┏┛┻━━━┛┻┓
  12. ┃ ☃ ┃
  13. ┃ ┳┛ ┗┳ ┃
  14. ┃ ┻ ┃
  15. ┗━┓ ┏━┛
  16. ┃ ┗━━━┓
  17. ┃ 神兽保佑 ┣┓
  18. ┃ 永无BUG! ┏┛
  19. ┗┓┓┏━┳┓┏┛
  20. ┃┫┫ ┃┫┫
  21. ┗┻┛ ┗┻┛
  22. """
  23. import time
  24. from LoggerService import LoggerService
  25. # import account_list as al
  26. from MySQLConnection import MySQLConnection
  27. from util import date_util
  28. def start_order_job(log):
  29. log.info('start_order_job')
  30. start_order_time = '2020-09-21 16:05:00'
  31. start_cost_time = '2020-09-21 16:35:00'
  32. a = 10817
  33. if __name__ == '__main__':
  34. log = LoggerService.logger_file('../test.log', 'abcd')
  35. st_unix = date_util.getYesterdayStartTime()
  36. et_unix = date_util.getTodayStartTime()
  37. et_unix = 1601136000
  38. et_unix = 1601139600
  39. print(1.4)
  40. print(int(1.4))
  41. for i in range(int((et_unix - st_unix) // 86400)):
  42. print('i', i)
  43. for i in range((et_unix - st_unix) // 86400):
  44. print('i', i)
  45. # sql = "select * from quchen_text.order where date=1601136000 and platform = '悠书阁'"
  46. # connect = MySQLConnection()
  47. # try:
  48. # page = 1
  49. # size = 50
  50. # pagination = connect.listByPage(sql, page, size)
  51. # print(pagination)
  52. # except Exception as e:
  53. # log.exception(e)
  54. # finally:
  55. # # 关闭数据库连接
  56. # connect.close()
  57. # scheduler = BlockingScheduler()
  58. #
  59. # #每天凌晨执行
  60. # #start_job_time = '2020-09-26 03:05:00'
  61. # # scheduler.add_job(start_all_job, 'interval', days=1, start_date=start_job_time)
  62. #
  63. # #每天凌晨3点到4点的30分钟都执行一次
  64. # scheduler.add_job(start_all_job, 'cron', hour='3-4', minute='35')
  65. #
  66. # # 每10秒执行一次
  67. # #scheduler.add_job(start_all_job, 'interval', seconds=2)
  68. #
  69. # scheduler.start()