This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gerador.py | |
import time | |
from threading import Thread | |
valueUpdate = -99 | |
class Gerador(Thread): | |
def __init__(self): | |
Thread.__init__(self) | |
self.nome = "" | |
self.atual = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import atualiza | |
x= 30 | |
print "x=",x, " id(x)=", id(x) | |
print "\nX deve sair com valor 5 \n" | |
atualiza.run(1,5,1,x) | |
print x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
def gera(valorInicio, valorFim, valorPasso): | |
while valorInicio <= valorFim: | |
yield valorInicio | |
valorInicio += valorPasso | |
def update(atual, novo, var): | |
print "var:", var, " id(var):", id(var) | |
if (novo >= atual): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyQt4 import QtCore, QtGui | |
from PyQt4 import Qwt5 | |
import atualiza | |
try: | |
_fromUtf8 = QtCore.QString.fromUtf8 | |
except AttributeError: | |
def _fromUtf8(s): | |
return s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
def gerador(value_start, value_end, value_step): | |
while value_start <= value_end: | |
yield value_start | |
value_start += value_step | |
def gerarValor(): | |
for x in gerador(1, 100, 0.2): | |
time.sleep(0.1) |