Help with code = Extract numerical value to variable

Sion Arrowsmith sion at viridian.paintbox
Fri Oct 23 07:07:44 EDT 2009


Steve  <zerocostproduct at gmail.com> wrote:
>If there is a number in the line I want the number otherwise I want a
>0
>I don't think I can use strip because the lines have no standards

What do you think strip() does? Read
http://docs.python.org/library/stdtypes.html#str.lstrip
*carefully* (help(''.lstrip) is slightly ambiguous).
set(string.printable).difference(string.digits) may help.

-- 
\S

   under construction




More information about the Python-list mailing list