Advertisement
Guest User

Untitled

a guest
Apr 28th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. import time
  2.  
  3. def gera(valorInicio, valorFim, valorPasso):
  4. while valorInicio <= valorFim:
  5. yield valorInicio
  6. valorInicio += valorPasso
  7.  
  8. def update(atual, novo, var):
  9. print "var:", var, " id(var):", id(var)
  10. if (novo >= atual):
  11. atual = novo
  12. var = atual
  13. print "var:", var, " id(var):", id(var)
  14.  
  15.  
  16. def run(valorInicio, valorFim, valorPasso, var):
  17.  
  18. atual = 0
  19. print "id(var):", id(var)
  20. for x in gera(valorInicio, valorFim, valorPasso):
  21. time.sleep(0.1)
  22. update(atual, x, var)
  23. print "\n", x
  24. print "id(var):", id(var)
  25. print "var:", var
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement