[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: do - loop

Jeroen Ruigrok van der Werven

1/7/2008 9:01:00 AM

-On [20080107 09:51], Hita Vora (hvora@usc.edu) wrote:
>I have a dataset which has about 3000 subjects in it. I take each subject
>and perform 3 to 4 geoprocessing tasks on it. Currently I have a model where
>I manually feed in each subject's ID and then the rest of the process is
>automated. I would like to automate the process such that it would
>automatically select another subject after the process has been completed on
>a specfic subject. ie to repeat the same process on each of the IDs.

Well, hopefully I understood you correctly, but if we assume that the dataset
is a simple list you can iterate over it as thus:

for subject in dataset:
do_geoprocessing(subject)

Dictionaries and other datatypes have similar means to construct an iterator.

Is this a bit what you want to achieve?

--
Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org> / asmodai
ã?¤ã?§ã?«ã?¼ã?³ ã?©ã?¦ã??ã?­ã??ã?¯ ã?´ã?¡ã?³ ã??ã?« ã?¦ã?§ã?«ã?´ã?§ã?³
http://www.in-n... | http://www.ra...
Vae victis!