<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><DIV style="BACKGROUND-COLOR: #fff; FONT-FAMILY: arial, helvetica, sans-serif; COLOR: #000; FONT-SIZE: 10pt">
<DIV style="RIGHT: auto">Hi !<BR>Within a web framework, I want want to pass a python sequence (list or tuple) to client-side javascript function as an array (javascript compatible)</DIV>
<DIV>e.g., I have this list:<BR>L = ['spam', 'ham', 'eggs', 12, (13.63)]</DIV>
<DIV>What is the correct way to convert L to javascript array format? </DIV>
<DIV><BR>1) jsonify the list and pass it to javascript<BR>(whether json format & javascript array are similar?)</DIV>
<DIV> </DIV>
<DIV>OR<VAR id=yiv2062593524yui-ie-cursor></VAR></DIV>
<DIV>2) <BR>>> import array<BR>>> y = array.array(i, L)<BR> then return y to javascript function</DIV>
<DIV>But the problem with this method is, it will give an array of basic values only.</DIV>
<DIV> </DIV>
<DIV>OR</DIV>
<DIV>3) Any other alternative?</DIV>
<DIV> </DIV>
<DIV style="RIGHT: auto">Thanks,<BR>Vineet<VAR id=yui-ie-cursor></VAR></DIV></DIV></div></body></html>