Re: How do I convert arithemtic string (like "2+2") to a number?

2005-02-06 Thread Adomas
Well, a bit more secure would be

eval(expression, {'__builtins__': {}}, {})

or alike.

-- 
http://mail.python.org/mailman/listinfo/python-list


Alternative to standard C "for"

2005-02-05 Thread adomas . paltanavicius
Hi there,

I am quite new to Python, and have a straight & simple question.
In C, there is for (init; cond; advance). We all know that.
In Python there are two ways to loop over i=A..B (numerical.):
1) i = A
   while ihttp://mail.python.org/mailman/listinfo/python-list