nyk0r

JavaScriptSerializer

Sep 11th, 2011
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. » import clr
  2. » clr.AddReferenceByPartialName('System.Web.Extensions')
  3. » from  System.Web.Script.Serialization import JavaScriptSerializer
  4. » js = JavaScriptSerializer()
  5. » js.Serialize({'label': 'Europe (EU27)', 'data': [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5], [2005, 2.0], [2006, 3.1], [2007, 2.9], [2008, 0.9]]})
  6. '{"data":[[1999,3],[2000,3.9],[2001,2],[2002,1.2],[2003,1.3],[2004,2.5],[2005,2],[2006,3.1],[2007,2.9],[2008,0.9]],"label":"Europe (EU27)"}'
  7. »
Advertisement
Add Comment
Please, Sign In to add comment