i have this code to print every new element in a list only when the
list length changes (while the list is updated by a thread running
elsewhere)...I was wondering if there is a pythonic way to do this? how
does one know when there is a new element in the list?<br>
<br>prevlength = 0<br>&nbsp;&nbsp;&nbsp; while geoCode.running:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; places =
geoCode.getResults() #returns a list with most up to date elements..the
list grows as the thread that updates it<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if len(places) &gt; prevlength:<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print places[prevlength]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; prevlength = len(places)<br><br><br>thank you!