test_read_ini.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. __title__ = '测试读取ini文件'
  5. @Time : 2020/9/26 18:36
  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 math
  24. # 获取当前文件所在目录的上一级目录
  25. # parent_dir_path = os.path.dirname(os.path.abspath('../..'))
  26. # config_path = parent_dir_path + '/conf/account_list_config.ini'
  27. #
  28. # # 读取数据库配置信息
  29. # config = configparser.ConfigParser(allow_no_value=True) #注意参数不能省
  30. # config.read(config_path, encoding='UTF-8')
  31. #
  32. # print(config.items("IPS"))
  33. # print(type(config.items("IPS")))
  34. # print(10 // int(1000) + 1)
  35. # print(1000 // int(1000) + 1)
  36. # print(1001 // int(1000) + 1)
  37. import time
  38. from datetime import datetime
  39. dtime = datetime.strptime('2019-11-14 13:49:32', "%Y-%m-%d %H:%M:%S")
  40. dd = ((int(time.mktime(dtime.timetuple())) + 8 * 3600) // 86400) * 86400 - 8 * 3600
  41. print(dtime, int(time.mktime(dtime.timetuple())), type(dtime), dtime.timetuple)
  42. print(dd, type(dd))
  43. per_page = 1000
  44. total_count = 40
  45. page = 1
  46. # print(math.ceil(0 / int(per_page)))
  47. print(math.ceil(40 / int(per_page)))
  48. print(math.ceil(1000 / int(per_page)))
  49. parameter = int(page) > math.ceil(total_count / int(per_page))
  50. print(parameter)
  51. print(math.ceil(0 / 100))
  52. print(math.ceil(100 / 100))
  53. print(math.ceil(101 / 100))
  54. for i in range(5):
  55. if 1 != 1:
  56. items = [0, 1]
  57. else:
  58. print('掌中云本次请求数据为空')
  59. items = []
  60. continue
  61. print('123345')
  62. for item in items:
  63. print(item)