still learning python stuff
This commit is contained in:
parent
f20f412e50
commit
59dee06c7e
|
@ -1,5 +1,5 @@
|
||||||
import os
|
import os
|
||||||
import thread
|
from threading import Thread
|
||||||
from mycroft import MycroftSkill, intent_handler
|
from mycroft import MycroftSkill, intent_handler
|
||||||
|
|
||||||
class RunScriptSkill(MycroftSkill):
|
class RunScriptSkill(MycroftSkill):
|
||||||
|
@ -31,7 +31,8 @@ class RunScriptSkill(MycroftSkill):
|
||||||
script_path = os.path.join(self.script_dir, script)
|
script_path = os.path.join(self.script_dir, script)
|
||||||
if script in self.scripts and os.path.isfile(script_path):
|
if script in self.scripts and os.path.isfile(script_path):
|
||||||
self.speak_dialog('Running', {'script': script})
|
self.speak_dialog('Running', {'script': script})
|
||||||
thread.start_new_thread(os.system, (script_path))
|
thread = Thread(target = os.system, args = (script_path, ))
|
||||||
|
thread.start()
|
||||||
else:
|
else:
|
||||||
self.speak_dialog('NotFound', {'script': script})
|
self.speak_dialog('NotFound', {'script': script})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue