test_read_ini.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. per_page = 1000
  38. total_count = 40
  39. page = 1
  40. # print(math.ceil(0 / int(per_page)))
  41. print(math.ceil(40 / int(per_page)))
  42. print(math.ceil(1000 / int(per_page)))
  43. parameter = int(page) > math.ceil(total_count / int(per_page))
  44. print(parameter)
  45. print(math.ceil(0 / 100))
  46. print(math.ceil(100 / 100))
  47. print(math.ceil(101 / 100))
  48. for i in range(5):
  49. if 1 != 1:
  50. items = [0, 1]
  51. else:
  52. print('掌中云本次请求数据为空')
  53. items = []
  54. continue
  55. print('123345')
  56. for item in items:
  57. print(item)