I have another newbie Python question. I have the following piece of code that I have a feeling is not written as pythonic as it should be:
rowindex = 0
while params.getfirst('myfield'+rowindex):
myid = params.getfirst('myfield'+rowindex)
# do stuff with myid
rowindex+=1
The input to this script is an HTML page that can have any number of input fields named "myfield#" where # starts at 0 and increases sequentially. In Perl, I would do something more like this:
rowindex = 0
while myid = params.getfirst('myfield'+rowindex):
#do stuff with myid
rowindex+=1
But that is not valid syntax in Python. I know what I have will work, but is there a better way? Thank you.