You should probably just store the name of the symbol in the dictionary as a string. You may also want to do that for the floats if precision issues come up.
Aaron Meurer On Fri, Jun 20, 2014 at 1:20 PM, TARUN GABA <tarun.ga...@gmail.com> wrote: > Hi > > I have a dict containing symbols as keys, mapped to float values. I need > to convert it to JSON format(for passing to Javascript). > > Here is an example dict: > > constants = {l: 10.0, m: 10.0, g: 9.81} > > python's json module cannot parse these symbols.What should be the best > approach to implement this? > > Thanks > > Tarun Gaba > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sympy+unsubscr...@googlegroups.com. > To post to this group, send email to sympy@googlegroups.com. > Visit this group at http://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/CAHAono2rMOfWi%3Dvx0Q1eKH2iQPQDhkEZ5HvTmAn94f2tpUpM-w%40mail.gmail.com > <https://groups.google.com/d/msgid/sympy/CAHAono2rMOfWi%3Dvx0Q1eKH2iQPQDhkEZ5HvTmAn94f2tpUpM-w%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2BhODMQrNoKh4Q%3DPy2n1sSEHSPFEKbJQeziHSotuK6AbQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.