On 26 April 2013 10:36, inshu chauhan <insidesh...@gmail.com> wrote: > > On Fri, Apr 26, 2013 at 2:39 PM, Peter Otten <__pete...@web.de> wrote: >> >> My crystal ball says that the 'for sy...' and 'for sx...' loops are >> running >> to completion, but you don't get the coordinates printed because you put >> them into the 'for l in f' loop which will only run once. > > Is there any means by which I can run this 'For l in f' loop again and again > ? >> >> The quick and dirty fix is to replace >> >> f = open(...) >> >> in the code you are not showing with >> >> f == list(open(...)) > > f is just a text file(csv format).. so why list ??
So that you can run the for l in f loop again and again. You can loop over a list as many times as you like but only once over a file (unless you reset the file pointer). Oscar -- http://mail.python.org/mailman/listinfo/python-list