You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
662 B
22 lines
662 B
import json |
|
|
|
from j import j_str |
|
|
|
with open('j.txt', 'r', encoding='utf-8') as f: |
|
d = json.load(f) |
|
print(type(d)) |
|
|
|
# print(d['data']) |
|
|
|
for r in d['data']: |
|
if r['policyType'] == 'O': |
|
print(f"{r['ticketTypeDesc']} - {r['policyType']} - {r['ticketTypeCate']}") |
|
pass |
|
if r['policyType'] == 'C': |
|
print(f"{r['ticketTypeDesc']} - {r['policyType']} - {r['bindCardData'][0]['cardLevelDesc']}") |
|
pass |
|
if r['policyType'] == 'V': |
|
print(f"{r['ticketTypeDesc']} - {r['policyType']} - {r['ticketTypeCode']}") |
|
pass |
|
# else: |
|
# print(f"{r['ticketTypeDesc']} - {r['policyType']} - {r['ticketTypeCate']}") |