Il giorno 13 ottobre 2011 20:03, Riccardo Lemmi <ricca...@reflab.com> ha scritto:
> simone s wrote: > [...] > > sstr = "sa" > lsstr = len(sstr) > > pos = leggi.find(sstr) > print pos > while True: > new_pos = leggi.find(sstr, pos+lsstr) > if new_pos == -1: > break > else: > pos = new_pos > print pos > Semplificando un po': sstr = "sa" lsstr = len(sstr) pos = 0 while True: pos = leggi.find(sstr, pos) if pos == -1: break else: print pos pos += lsstr Ciao -- Daniele www.fugamatematica.blogspot.com giusto! nel verso forse è perché non guardiamo le cose Quando non ci capiamo,
_______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python