[Tutor] script question

R. Alan Monroe amonroe at columbus.rr.com
Mon Sep 26 23:51:24 CEST 2005

> for i in passwordlist:
>   if i == port:
>     os.system("d:\\tnd\\bin\\cawto.exe -cat NetNet " + sys.argv[1] + " " +
>        sys.argv[2] + " " + sys.argv[3] + " " + sys.argv[4])

If you don't have duplicates in your list, a "break" after the
os.system line might help, because once you've found what you're
looking for you can skip the rest.

> I'd like to know if there is a more efficient way to do this and if there is
> a way to have these functions performed with the least amount of time
> possible (the ini file could grow quite large).

If you wanted to get tricky you could do things like sort the list and
do a binary search on it instead of a linear search.


More information about the Tutor mailing list