Skip to content

Instantly share code, notes, and snippets.

@bjcubsfan
Created December 27, 2011 21:02
Show Gist options
  • Save bjcubsfan/1525098 to your computer and use it in GitHub Desktop.
Save bjcubsfan/1525098 to your computer and use it in GitHub Desktop.
How to list over a copy of a loop
!/usr/bin/env python
import pdb
expected_rngs = range(0,10)
file_list = [0, 1, 2, 3, 4, 5, 6, 8, 9]
for antenna in expected_rngs[:]:
print "*********************************************************************"
print "CHECKING", antenna
for rng in file_list:
print "checking", rng
if rng == antenna:
expected_rngs.remove(antenna)
print "removing", antenna
break
print "*********************************************************************"
print "*********************************************************************"
print expected_rngs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment