Mar-10-2018, 11:05 AM
hi
i have a class using a thread as object
how can i give him a name. it will help the debugging in pycharm
temp.py
in pycharm it appears has Thread7
thanks
i have a class using a thread as object
how can i give him a name. it will help the debugging in pycharm
temp.py
class WTemp(threading.Thread): def __init__(self, sleep): threading.Thread.__init__(self) self.sleep = sleep self.W_temp = 0 def run(self): while True: # reads every sleep interval >0.8 (sensor response minimum delay) self.W_temp = W1ThermSensor().get_temperature() time.sleep(self.sleep) def read_temp(self): water_temp = self.W_tempmain.py
from temp import Wtemp Wtemp.start()how do i give a name to the thread .
in pycharm it appears has Thread7
thanks