I have a class and array in a loop. I'm filling the object and appending it to the array. How do I pass array data to web side through JSON? I have an error that says JSON is not serializable. How can I serialize to a JSON?
class myclass(object):
def __init__(self,vehicle,mng01):
self.vehicle = vehicle
self.vehicle = vehicle
#--Main function--
@subApp.route('/jsontry', method=['POST'])
def data():
for x in list:
vehicle_sum.append(myclass( x,str(mng01))
return json.dumps({'success':'1','vehicle':vehicle_sum})