Python to javascript communication
JSON is definitely the way to go. It has a very small overhead and is capable of storing almost any kind of data. I am not a python expert, but i am sure that there is some kind of en/decoder available.
OK so im using websockets to let javascript talk to python and that works very well BUT the data i need to send often has several parts like an array, (username,time,text) but how could i send it ? I originally though to encode each one in base64 or urlencode then use a character like | which those encoding methods will never use and then split the information. Unfortunately i cant find a method which both python and javascript can both do.
So the question, is there a encoding method which bath can do OR is there a different better way i can send the data because i havent really done anything like this before. (I have but AJAX requests and i send that data URL encoded). Also im not sending miles of text, about 100bytes at a time if that.
thankyou !
edit
Most comments point to JSON,so, Whats the best convert to use for javascript because javascript stupidly cant convert string to JSON,or the other way round.
Finished
Well jaascript does have a native way to convert javascript to string, its just hidden form the world. JSON.stringify(obj, [replacer], [space]) to convert it to a string and JSON.parse(string, [reviver]) to convert it back