Perl to Python
Loops
While
while a>1: print a while true: pass # does nothing
You cannot say while row=mysql.fetchone(): in Python. Use the iter command like this:
for row in iter(cursor.fetchone, None): do_something...
If
if a>1: ... elif a<1: ... else: ...
For
for element in list: print element for i in range(10): print i
