Re: String to float

Sjoerd Mullender (Sjoerd.Mullender@cwi.nl)
Mon, 08 Nov 1993 15:05:02 +0100

On Mon, Nov 8 1993 Gerry Stringer wrote:

> I've probably missed the obvious but how do I convert a string object
> to a float in Python?

The standard way of doing that is to use eval:
pi = eval('3.14')

Sjoerd Mullender
CWI, dept. CST, Kruislaan 413, 1098 SJ Amsterdam, Netherlands
email: Sjoerd.Mullender@cwi.nl fax: +31 20 592 4199
phone: +31 20 592 4127 telex: 12571 mactr nl