python Programming Glossary: my_count
Why doesn't this loop display an updated object count every five seconds? http://stackoverflow.com/questions/2221247/why-doesnt-this-loop-display-an-updated-object-count-every-five-seconds code to output the number of Things every 5 seconds def my_count while True print Number of Things d Thing.objects.count time.sleep.. print Number of Things d Thing.objects.count time.sleep 5 my_count If another process generates a new Thing while my_count is running.. 5 my_count If another process generates a new Thing while my_count is running my_count will keep printing the same number even..
|