1 Star 0 Fork 0

侯真杰/builder_excel

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test.py 10.58 KB
一键复制 编辑 原始数据 按行查看 历史
# coding: UTF-8
import time
from functools import wraps
import config
import re
def isClass(objA, objB):
"""判断类型是否一致"""
return type(objA) == type(objB)
def isList(obj):
"""判断是否是 列表"""
return isinstance(obj, list)
def isDict(obj):
return isinstance(obj, dict)
def compare(objA, objB):
if not isClass(objA, objB): return False
if not len(objA) == len(objB): return False
def compareObj(objA, objB, flag):
if isList(objA):
if not sorted(objA) == sorted(objB):
"判断排序后是否一致"
return False
elif isDict(objA):
pass
else:
pass
# import xlwings as xw
#
# app = xw.App(visible=False, add_book=False)
# app.display_alerts = False # 警告关闭
# app.screen_updating = False # 屏幕更新关闭
s = "asdfa: 2w3wer:"
l = ['authority: api.huoban.com', 'accept: application/json', 'accept-language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6', 'authorization: Bearer WhU1SW6dnj7wvmVYteiMAFxuFclnttHBfKhZMYw9012', 'cache-control: no-cache', 'content-type: application/json', 'cookie: visit_token=1666086009737; HUOBAN_SESSIONID=88d6935c0f951427cc8836e2e323f256; user_id=3232861; Hm_lvt_29e645b6615539290daae517d6a073c9=1669686870,1669778057,1669862620,1669950422; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%223232861%22%2C%22first_id%22%3A%22183ea76f3fd4b5-03e6277897244fa-72422f2d-2304000-183ea76f3fe12e2%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%2C%22%24latest_referrer%22%3A%22%22%2C%22%24latest_utm_source%22%3A%22evoke_help%22%2C%22%24latest_utm_medium%22%3A%22embed%22%7D%2C%22identities%22%3A%22eyIkaWRlbnRpdHlfbG9naW5faWQiOiIzMjMyODYxIiwiJGlkZW50aXR5X2Nvb2tpZV9pZCI6IjE4M2VhNzZmM2ZkNGI1LTAzZTYyNzc4OTcyNDRmYS03MjQyMmYyZC0yMzA0MDAwLTE4M2VhNzZmM2ZlMTJlMiJ9%22%2C%22history_login_id%22%3A%7B%22name%22%3A%22%24identity_login_id%22%2C%22value%22%3A%223232861%22%7D%2C%22%24device_id%22%3A%22183ea76f3fd4b5-03e6277897244fa-72422f2d-2304000-183ea76f3fe12e2%22%7D; HUOBAN_SESSIONID_BETA=a3b5fd062b64ddf0c60a323cbbabca8d; HUOBAN_SYNC=2b0bFiXMpyDNZPIdP65DB%2BpaPAYKIl3o3REgLtc7PWONEv6scTaAWZIewReeU3gnvidnnkhK0%2BZJhQ; access_token=6HwWQVAruev5K3GHMkjc2GxsdqLWmmc8yFYVGydT001; Hm_lpvt_29e645b6615539290daae517d6a073c9=1669971151; v5=1; canary_v5=always; HUOBAN_AUTH_BETA=81248931637ee3c0f053ac7a424d1b79; HUOBAN_DATA_BETA=1A%2FahGBpdOqM0VllzkCNQ8aCiaN5f08KAoQop5sdK%2FuvhNuUm6D0dvlVPcBRN1cY%2FimwqECapAIU2qfGY0%2BeoQ%3D%3D; HUOBAN_AUTH=65ab7a7d52d2afa2836c1f08f277e31d; HUOBAN_DATA=Kc%2F3FKyLEzTtgB408K4wghs%2F0CRhvMJXt6yU9XpN1DpV5ArUynGC0omqWHcX%2Fgkrfuk7VkJYp9GeD265qgAGOg%3D%3D', 'origin: https://app.huoban.com', 'pragma: no-cache', 'referer: https://app.huoban.com/', 'sec-ch-ua: "Microsoft Edge";v="107", "Chromium";v="107", "Not=A?Brand";v="24"', 'sec-ch-ua-mobile: ?0', 'sec-ch-ua-platform: "Windows"', 'sec-fetch-dest: empty', 'sec-fetch-mode: cors', 'sec-fetch-site: same-site', 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 'x-huoban-client-id: 1', 'x-huoban-request-id: a80d7f51f5679485a6c82b6586614dfa', 'x-huoban-security-token;', 'x-huoban-sensors: %7B%22visit_type%22%3A%22%E5%86%85%E9%83%A8%E7%B3%BB%E7%BB%9F%22%2C%22client_id%22%3A%221%22%2C%22platform_type%22%3A%22Web%E6%B5%8F%E8%A7%88%E5%99%A8%22%2C%22client_version%22%3A%22v4%22%2C%22is_register%22%3Atrue%2C%22env%22%3A%22prod%22%2C%22_distinct_id%22%3A%223232861%22%2C%22application_url%22%3A%22https%3A%2F%2Fapp.huoban.com%2Ftables%2F2100000017679108%2Fimport%22%2C%22company_id%22%3A%225100000000001643%22%2C%22space_id%22%3A%224000000003480638%22%7D']
def singleton(cls):
_instances = {}
@wraps(cls)
def get_instance(*args, **kwargs):
if cls not in _instances:
_instances[cls] = cls(*args, **kwargs)
return _instances[cls]
return get_instance
resres = """{"code":0,"message":"success","data":{"page":{"page_id":7000000001001229,"icon":{},"title":"\u65b0\u9875\u9762","cover_image":[],"background":{},"page_width":"default","mode":"default","theme":{},"card_map":{"7100000001001277":{"id":7100000001001277,"created_on":1674991264,"updated_on":1674991411,"created_by":{"user_id":1376905,"name":"A\u5458\u5de5","avatar":"https:\/\/dev-hb-public-1305349001.cos.ap-shanghai.myqcloud.com\/user_avatar\/188571988\/0?imageMogr2\/thumbnail\/128x128>","name_conf":{"type":"real"},"user_type":"normal"},"layout":[{"id":7200000001012296,"x":0,"y":0,"h":12,"w":12}],"background":[],"page_id":7000000001001229,"extra_config":{},"extra":[]}},"cards":[7100000001001277],"element_map":{"7200000001012292":{"id":7200000001012292,"synced_widget_id":0,"name":"\u5934\u90e8","description":"","type":"header","icon":{},"style":{},"extra_config":{"buttons":[],"layout_type":"l1","logo":{"logo_bright":null,"logo_dark":null,"logo_type":"bright","type":"image"},"menu":[],"width_type":"fill"},"rights":[],"space_id":4000000030670069,"is_display":true,"is_synced":true,"is_name_show":false,"is_dynamic_height":false,"is_lazy_mount":false,"created_on":1674991264,"updated_on":1674991264,"page_id":7000000001001229,"__meta_data__":{},"created_by":{"user_id":1376905,"name":"A\u5458\u5de5","avatar":"https:\/\/dev-hb-public-1305349001.cos.ap-shanghai.myqcloud.com\/user_avatar\/188571988\/0?imageMogr2\/thumbnail\/128x128>","phone":"","email":"[email protected]","name_conf":{"type":"real"},"user_type":"normal"},"updated_by":{"user_id":1376905,"name":"A\u5458\u5de5","avatar":"https:\/\/dev-hb-public-1305349001.cos.ap-shanghai.myqcloud.com\/user_avatar\/188571988\/0?imageMogr2\/thumbnail\/128x128>","phone":"","email":"[email protected]","name_conf":{"type":"real"},"user_type":"normal"}},"7200000001012293":{"id":7200000001012293,"synced_widget_id":0,"name":"\u9875\u811a","description":"","type":"footer","icon":{},"style":{},"extra_config":{"menu":[],"text":""},"rights":[],"space_id":4000000030670069,"is_display":true,"is_synced":true,"is_name_show":false,"is_dynamic_height":false,"is_lazy_mount":false,"created_on":1674991264,"updated_on":1674991264,"page_id":7000000001001229,"__meta_data__":{},"created_by":{"user_id":1376905,"name":"A\u5458\u5de5","avatar":"https:\/\/dev-hb-public-1305349001.cos.ap-shanghai.myqcloud.com\/user_avatar\/188571988\/0?imageMogr2\/thumbnail\/128x128>","phone":"","email":"[email protected]","name_conf":{"type":"real"},"user_type":"normal"},"updated_by":{"user_id":1376905,"name":"A\u5458\u5de5","avatar":"https:\/\/dev-hb-public-1305349001.cos.ap-shanghai.myqcloud.com\/user_avatar\/188571988\/0?imageMogr2\/thumbnail\/128x128>","phone":"","email":"[email protected]","name_conf":{"type":"real"},"user_type":"normal"}},"7200000001012294":{"id":7200000001012294,"synced_widget_id":0,"name":"\u65b0\u9875\u9762","description":"","type":"cover","icon":{},"style":{},"extra_config":{},"rights":[],"space_id":4000000030670069,"is_display":true,"is_synced":true,"is_name_show":false,"is_dynamic_height":false,"is_lazy_mount":false,"created_on":1674991264,"updated_on":1674991264,"page_id":7000000001001229,"__meta_data__":{},"created_by":{"user_id":1376905,"name":"A\u5458\u5de5","avatar":"https:\/\/dev-hb-public-1305349001.cos.ap-shanghai.myqcloud.com\/user_avatar\/188571988\/0?imageMogr2\/thumbnail\/128x128>","phone":"","email":"[email protected]","name_conf":{"type":"real"},"user_type":"normal"},"updated_by":{"user_id":1376905,"name":"A\u5458\u5de5","avatar":"https:\/\/dev-hb-public-1305349001.cos.ap-shanghai.myqcloud.com\/user_avatar\/188571988\/0?imageMogr2\/thumbnail\/128x128>","phone":"","email":"[email protected]","name_conf":{"type":"real"},"user_type":"normal"}}},"widget_map":{"7200000001012296":{"id":7200000001012296,"synced_widget_id":0,"name":"\u5d4c\u5165","description":"","type":"embed","icon":{"data":"","type":"emoji"},"style":{"card":{"background_fill_var":{"data":"yellow-color-50","type":"color"},"has_background_blur":false,"has_rounded":true,"has_shadow":true},"style_type":"common","title":{"background_color_var":"","has_background":false,"has_rounded":true,"name_as_title":false}},"extra_config":{},"rights":[],"space_id":4000000030670069,"is_display":true,"is_synced":true,"is_name_show":false,"is_dynamic_height":false,"is_lazy_mount":false,"created_on":1674991411,"updated_on":1675137894,"page_id":7000000001001229,"__meta_data__":{},"created_by":{"user_id":1376905,"name":"A\u5458\u5de5","avatar":"https:\/\/dev-hb-public-1305349001.cos.ap-shanghai.myqcloud.com\/user_avatar\/188571988\/0?imageMogr2\/thumbnail\/128x128>","phone":"","email":"[email protected]","name_conf":{"type":"real"},"user_type":"normal"},"updated_by":{"user_id":1376905,"name":"A\u5458\u5de5","avatar":"https:\/\/dev-hb-public-1305349001.cos.ap-shanghai.myqcloud.com\/user_avatar\/188571988\/0?imageMogr2\/thumbnail\/128x128>","phone":"","email":"[email protected]","name_conf":{"type":"real"},"user_type":"normal"}}},"space_id":4000000030670069,"parent_page_id":7000000001001219,"has_cover":true,"has_header":false,"has_footer":false,"is_locked":false,"extra_config":{"theme":{"type":"default","config":{"default":{"background_fill_var":{"type":"defaultImage","data":""},"has_background_blur":false,"accent_color":"pink-color-a"}}}},"rights":["view","update","children_page_edit","share","manage","delete","transfer"],"owner_user_id":1376905,"created_on":"2023-01-29 19:21:04","updated_on":"0000-00-00 00:00:00","__meta_data__":{},"created_by":{"user_id":1376905,"name":"A\u5458\u5de5","avatar":"https:\/\/dev-hb-public-1305349001.cos.ap-shanghai.myqcloud.com\/user_avatar\/188571988\/0?imageMogr2\/thumbnail\/128x128>","phone":"","email":"[email protected]","name_conf":{"type":"real"},"user_type":"normal"},"updated_by":{"user_id":1376905,"name":"A\u5458\u5de5","avatar":"https:\/\/dev-hb-public-1305349001.cos.ap-shanghai.myqcloud.com\/user_avatar\/188571988\/0?imageMogr2\/thumbnail\/128x128>","phone":"","email":"[email protected]","name_conf":{"type":"real"},"user_type":"normal"}}},"meta":{"trace_id":"1675138014437247"},"version":"v1.0.1"}"""
if __name__ == '__main__':
# import json
#
# j = json.loads(resres)
# j['data']['page']['widget_map']['7200000001012296']['updated_on']=1672326119
# with open(r'C:\Users\86136\Desktop\response.txt', 'w') as f:
# r = json.dump(j,f)
# timeStamp = -50929082700
# timeArray = time.localtime(timeStamp)
# otherStyleTime = time.strftime("%Y--%m--%d %H:%M:%S", timeArray)
# print(otherStyleTime)
import filetype
t = filetype.guess_mime(r'C:\Users\86136\Pictures\大疆\DJI Mavic 3 Classic.jpg')
print(t)
print(filetype.guess(r'C:\Users\86136\Pictures\大疆\DJI Mavic 3 Classic.jpg').mime)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/hou-zhenjie/builder_excel.git
[email protected]:hou-zhenjie/builder_excel.git
hou-zhenjie
builder_excel
builder_excel
main

搜索帮助