Looking at the docs for warnings.simplefilter (http://docs.python.org/2/library/warnings.html) I think the following script should only produce one warning at each line as any message is matched by the simple filter
import warnings warnings.simplefilter('default') for i in xrange(2): warnings.warn('Warning message') # This prints 1 warning warnings.warn("Warning %d" % i) # This prints 2 warnings What do I need to do to get the warnings module just to print one warning for the second warnings.warn line? Thanks, John. -- http://mail.python.org/mailman/listinfo/python-list