Simple Python Spider

2007-08-23 Thread luca bertini
Hi everybody, i'm new to the forum so: hello everybody (should I say  
"world"?) ^_^
I'm trying to do a simple spider in python which:

1) ask google a query
2) parse the data

I'm a python newbie so *any* help would be very, very welcommed.
Thanks in advice!

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


strings (dollar.cents) into floats

2007-08-30 Thread luca bertini
Hi,

i have strings which look like money values (ie 34.45)
is there a way to convert them into float variables?
everytime i try I get this error: "numb = float(my_line) ValueError:  
empty string for float()"
"
here's the code



import sys
import re

for line in sys.stdin.readlines():
my_line = line.rstrip()
numb = float(my_line)
print numb
-- 
http://mail.python.org/mailman/listinfo/python-list