Good time of day everyone.
I want to create plugin for ST3. But I am not familar with Python3. I decided to write it in other script language. So, I need code snippet to run my script (external program) in backround mode and to do something when script is finished.
I have:
[code]class FuncThread(threading.Thread):
def init(self, target):
self._target = target
threading.Thread.init(self)
def run(self):
self._target()[/code]
Somewhere in “run”
thread = threading.Thread(target = my_long_calculate, args = (self.view, edit))
thread.start()
my_long_calculate looks approximately as:
subprocess.Popen(cmd, stdout=subprocess.PIPE, startupinfo=startupinfo).communicate()[0]
But my ST still is hanging (locked) when my_long_calculate() is running.
What am I doing wrong?