scanValeur.py 365 B

123456789101112131415161718192021
  1. from threading import Thread
  2. from valeurs import *
  3. class Scan(Thread):
  4. def __init__(self, valeur,verrou):
  5. Thread.__init__(self)
  6. def run(self):
  7. i=0
  8. while 1:
  9. #~ with verrou:
  10. tmp=valeur[i].getNewTaux()
  11. if tmp-valeur[i].getTaux() > 0.5:
  12. valeur[i].MiseEnVente()
  13. time.sleep(0.4)
  14. i=i+1
  15. if i<39:
  16. i=0