Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- g = 0
- c = 0
- a = 0
- t = 0
- class ProcessData(threading.Thread):
- def __init__(self, batch):
- threading.Thread.__init__(self)
- self.batch = batch
- self.g = 0
- self.c = 0
- self.a = 0
- self.t = 0
- def run(self):
- global g, c, a, t
- threadLock.acquire()
- for line in self.batch:
- line = line.lower()
- for nucleotide in line:
- if nucleotide == "g":
- self.g += 1
- if nucleotide == "c":
- self.c += 1
- if nucleotide == "a":
- self.a += 1
- if nucleotide == "t":
- self.t += 1
- g += self.g
- c += self.c
- a += self.a
- t += self.t
- print(g+c+a+t)
- threadLock.release()
- File "gc_threaded.py", line 49, in run t += self.t
- TypeError: unsupported operand type(s) for +=: 'ProcessData' and 'int'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement