#!/usr/bin/env python # -*- coding: utf-8 -*- """ __title__ = '测试读取ini文件' @Time : 2020/9/26 18:36 @Author : Kenny-PC @Software: PyCharm # code is far away from bugs with the god animal protecting I love animals. They taste delicious. ┏┓ ┏┓ ┏┛┻━━━┛┻┓ ┃ ☃ ┃ ┃ ┳┛ ┗┳ ┃ ┃ ┻ ┃ ┗━┓ ┏━┛ ┃ ┗━━━┓ ┃ 神兽保佑 ┣┓ ┃ 永无BUG! ┏┛ ┗┓┓┏━┳┓┏┛ ┃┫┫ ┃┫┫ ┗┻┛ ┗┻┛ """ import math # 获取当前文件所在目录的上一级目录 # parent_dir_path = os.path.dirname(os.path.abspath('../..')) # config_path = parent_dir_path + '/conf/account_list_config.ini' # # # 读取数据库配置信息 # config = configparser.ConfigParser(allow_no_value=True) #注意参数不能省 # config.read(config_path, encoding='UTF-8') # # print(config.items("IPS")) # print(type(config.items("IPS"))) # print(10 // int(1000) + 1) # print(1000 // int(1000) + 1) # print(1001 // int(1000) + 1) import time from datetime import datetime dtime = datetime.strptime('2019-11-14 13:49:32', "%Y-%m-%d %H:%M:%S") dd = ((int(time.mktime(dtime.timetuple())) + 8 * 3600) // 86400) * 86400 - 8 * 3600 print(dtime, int(time.mktime(dtime.timetuple())), type(dtime), dtime.timetuple) print(dd, type(dd)) per_page = 1000 total_count = 40 page = 1 # print(math.ceil(0 / int(per_page))) print(math.ceil(40 / int(per_page))) print(math.ceil(1000 / int(per_page))) parameter = int(page) > math.ceil(total_count / int(per_page)) print(parameter) print(math.ceil(0 / 100)) print(math.ceil(100 / 100)) print(math.ceil(101 / 100)) for i in range(5): if 1 != 1: items = [0, 1] else: print('掌中云本次请求数据为空') items = [] continue print('123345') for item in items: print(item)