test_read_ini.py 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 configparser
  24. import math
  25. import os
  26. # 获取当前文件所在目录的上一级目录
  27. # parent_dir_path = os.path.dirname(os.path.abspath('../..'))
  28. # config_path = parent_dir_path + '/conf/account_list_config.ini'
  29. #
  30. # # 读取数据库配置信息
  31. # config = configparser.ConfigParser(allow_no_value=True) #注意参数不能省
  32. # config.read(config_path, encoding='UTF-8')
  33. #
  34. # print(config.items("IPS"))
  35. # print(type(config.items("IPS")))
  36. # print(10 // int(1000) + 1)
  37. # print(1000 // int(1000) + 1)
  38. # print(1001 // int(1000) + 1)
  39. per_page = 1000
  40. total_count = 40
  41. page = 1
  42. # print(math.ceil(0 / int(per_page)))
  43. print(math.ceil(40 / int(per_page)))
  44. print(math.ceil(1000 / int(per_page)))
  45. parameter = int(page) > math.ceil(total_count / int(per_page))
  46. print(parameter)
  47. print(math.ceil(0 / 100))
  48. print(math.ceil(100 / 100))
  49. print(math.ceil(101 / 100))
  50. for i in range(5):
  51. if 1 != 1:
  52. items = [0,1]
  53. else:
  54. print('掌中云本次请求数据为空')
  55. items = []
  56. continue
  57. print('123345')
  58. for item in items:
  59. print(item)