demo.py
2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- coding: utf-8 -*-
# @Time : 2021/7/28 16:59
# @Author : Ljq
# @File : demo.py
# @Software: PyCharm
"""
"""
import json
import datetime,time
import urllib
# print(time.localtime())
import urllib3
# print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
# a = {"aa":"阿三大苏打","bb":"bb","cc":{"cc1":"啊实打","cc2":"ad"}}
# print(a)
# data = {"cc":{"cc1":"2"}}
# b = dict(a,**data)
# print(b)
# def doDcit(**kwargs):
# a = {"aa": "阿三大苏打", "bb": "bb", "cc": {"cc1": "啊实打","cc2":"ad"}}
# print(a)
# b = dict(a,**kwargs)
# print(b)
a = {"code":"200","data":[{"autoPass":2,"autoSave":1,"carTypeName":"板车","code":"003","id":53,"number":"0007","remark":"","status":1,"tag":"jmsf","weight":333},{"autoPass":1,"autoSave":1,"carTypeName":"挂车","code":"gc","id":59,"number":"0030","remark":"","status":1,"tag":"jmsf","weight":1},{"autoPass":2,"carTypeName":"柜车","code":"23","id":60,"number":"0031","remark":"","status":1,"tag":"jmsf","weight":0},{"autoPass":1,"autoSave":1,"carTypeName":"地排车","code":"008","id":87,"number":"0001","remark":"","status":1,"tag":"jmsf","weight":2},{"autoPass":2,"autoSave":1,"carTypeName":"玉玺","code":"888","id":128,"number":"0042","remark":"","status":1,"tag":"jmsf","weight":0},{"autoPass":2,"carTypeName":"军车","code":"555","id":61,"number":"0013","remark":"","status":1,"tag":"jmsf","weight":0},{"autoPass":2,"carTypeName":"小面包","code":"","id":142,"number":"0008","remark":"","status":1,"tag":"jmsf","weight":22},{"autoPass":1,"autoSave":1,"carTypeName":"小轿车","code":"001","id":51,"number":"0002","remark":"","status":1,"tag":"jmsf","weight":0},{"autoPass":2,"carTypeName":"123456789012345","code":"1245","id":160,"number":"0044","remark":"","status":1,"tag":"jmsf","weight":11},{"autoPass":2,"carTypeName":"111111111222222","code":"6432","id":161,"number":"0045","remark":"","status":1,"tag":"jmsf","weight":22},{"autoPass":2,"autoSave":1,"carTypeName":"test0731","code":"12345","id":162,"number":"0047","remark":"asdf g hgsaf","status":1,"tag":"jmsf","weight":11}],"message":"OK","result":"OK","success":True}
print(a["data"])
# lambda file_name: os.path.getmtime(report_path + file_name)
b = a["data"].index([i for i in a["data"] if i["carTypeName"]=="地排车"][0])
print(b)
# c ="2" if b !=None else "1"
# print(c)