thanks for you suggestions :-) .. cheers,
On 11/23/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > I wrote: > > > if you cannot cache session data on the server side, I'd > > recommend inventing a custom record format, and doing your > > own parsing. turning your data into e.g. > > > > "foo:1:foobar:3:0+foo1:2:foobar1:3:1+foo2:2:foobar2:3:2" > > > > is trivial, and the resulting string can be trivially parsed by a couple > > of string splits and int() calls. > > on the other hand, the "myeval" function I posted here > > http://article.gmane.org/gmane.comp.python.general/433160 > > should be able to deal with your data, as well as handle data from > malevolent sources without bringing down your computer. > > just add > > if token[1] == "(": > out = [] > token = src.next() > while token[1] != ")": > out.append(_parse(src, token)) > token = src.next() > if token[1] == ",": > token = src.next() > return tuple(out) > > after the corresponding "[" part, and call it like: > > data = myeval("[" + input + "]") > > </F> > > > > -- > http://mail.python.org/mailman/listinfo/python-list > -- ---- Endless the world's turn, endless the sun's spinning Endless the quest; I turn again, back to my own beginning, And here, find rest. -- http://mail.python.org/mailman/listinfo/python-list