[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.python

do - loop

Hita Vora

1/5/2008 4:10:00 AM

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.

Any help such as a dummy code would be greatly appreciated.

Thanks.

Hita

1 Answer

Ben Finney

1/7/2008 9:05:00 AM

0

Hita Vora <hvora@usc.edu> writes:

> 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.

def do_the_stuff(subject):
""" Do the stuff to a single subject """
pass

for this_subject in all_subjects:
do_the_stuff(this_subject)

--
\ "Unix is an operating system, OS/2 is half an operating system, |
`\ Windows is a shell, and DOS is a boot partition virus." |
_o__) â??Peter H. Coffin |
Ben Finney