illegal_code.py 3.85 KB
#encoding=utf-8
wenan_illegal_code_dict = [
				{"code":"00","name":"正常"},
				{"code":"01","name":"拥堵"},
				{"code":"02","name":"小车走公交道"},
				{"code":"03","name":"异常停车"},
				{"code":"04","name":"违法停车"},
				{"code":"05","name":"压实线或者压黄线"},
				{"code":"06","name":"逆行"},
				{"code":"07","name":"违章掉头"},
				{"code":"08","name":"直行闯红灯"},
				{"code":"09","name":"左转闯红灯"},
				{"code":"10","name":"右转闯红灯"},
				{"code":"11","name":"非法直行"},
				{"code":"12","name":"机动车占用非机动车道"},
				{"code":"13","name":"非法右转"},
				{"code":"14","name":"非法左转"},
				{"code":"15","name":"行人"},
				{"code":"16","name":"遗撒"},
				{"code":"17","name":"交通事故"},
				{"code":"18","name":"超高速"},
				{"code":"19","name":"超低速"},
				{"code":"20","name":"礼让行人"},
				{"code":"21","name":"超速"},
				{"code":"22","name":"紧急停车带停车"},
				{"code":"23","name":"大型货车不按规定车道行驶"},
				{"code":"24","name":"限时单行"},
				{"code":"25","name":"压白线"},
				{"code":"26","name":"跨线变道"},
				{"code":"27","name":"禁止左转"},
				{"code":"28","name":"禁止右转"},
				{"code":"29","name":"路口滞留"},
				{"code":"30","name":"绿灯滞留"},
				{"code":"31","name":"限号"},
				{"code":"32","name":"外地车限行"},
				{"code":"33","name":"区间超速"},
				{"code":"36","name":"未系安全带"},
				{"code":"37","name":"黄标车禁行"},
				{"code":"38","name":"使用手持电话"},
				{"code":"40","name":"缓行"},
				{"code":"41","name":"畅通"},
				{"code":"42","name":"国标2014直行闯红灯"},
				{"code":"43","name":"国标2014左转闯红灯"},
				{"code":"44","name":"国标2014右转闯红灯"},
				{"code":"45","name":"超速百分之10到20"},
				{"code":"46","name":"超速百分之20到50"},
				{"code":"47","name":"超速百分之50到70"},
				{"code":"48","name":"超速百分之70以上"},
				{"code":"49","name":"区间超速百分之10到20"},
				{"code":"50","name":"区间超速百分之20到50"},
				{"code":"51","name":"区间超速百分之50到70"},
				{"code":"52","name":"区间超速百分之70以上"},
				{"code":"54","name":"大弯小转检测"},
				{"code":"55","name":"左转机动车未让直行车辆先行"},
				{"code":"56","name":"不按规定未依次交替驶入"},
				{"code":"57","name":"不按规定使用远光灯"},
				{"code":"58","name":"行人闯红灯"},
				{"code":"59","name":"危险品车辆"},
				{"code":"60","name":"右转未让非机动车"},
				{"code":"61","name":"非机动车逆行"},
				{"code":"62","name":"渣土车"},
				{"code":"63","name":"渣土车未盖苫盖"},
				{"code":"64","name":"抛洒物"},
				{"code":"65","name":"拥堵时滞留人行横道"},
				{"code":"66","name":"旧领馆车牌"},
				{"code":"67","name":"机动车违反禁令指示"},
				{"code":"68","name":"压倒流带"},
				{"code":"69","name":"前排抱小孩"},
				{"code":"70","name":"号牌污损"},
				{"code":"71","name":"非机动车占用机动车道"},
				{"code":"72","name":"危险品运输车无押运员"},
				{"code":"73","name":"夜间开车放下遮阳板"},
				{"code":"74","name":"夜间行车不开灯"},
				{"code":"75","name":"车载货物超长超宽"},
				{"code":"76","name":"渣土车冒尖"}
			]

import xlrd,xlwt,json

workbook = xlwt.Workbook(encoding='utf-8')
worksheet = workbook.add_sheet('sheet1')

worksheet.write(0,0,label='违法类型')
worksheet.write(0,1,label='违法Code')
i = 1
for illegal in wenan_illegal_code_dict:
    illegal_name = illegal['name']
    illegal_code = illegal['code']
    worksheet.write(i,0,illegal_name)
    worksheet.write(i,1,illegal_code)
    i = i +1
workbook.save("illegal.xls")