Lately, I have been integrating a bunch of insteon HA devices with my existing EG configuration. I have configured simple python scripts throughout my lighting scene commands. I notice a black window briefly appearing when each python command is executed. I am not concerned with any results from the commands. Is it possible to hide these windows?
thanks.
sone
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Python window control?
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Python window control?
Yes, it is of course possible. You can find many examples on the Internet.sideone wrote:Is it possible to hide these windows?
It might look like this:
Code: Select all
subprocess.Popen(['insteon_command.bat'], shell=True, creationflags=subprocess.SW_HIDE)Re: Python window control?
Pako-
I am new to python, but assumed the issue was from the eg and not the subprocess output. I have adjusted all my scripts with this code, and now my system is finally integrated!!
Is it possible to spawn the python scripts so that EG doesn't pause while subprocess and sleep commands are processing?
thank you very much for the assistance!
I am new to python, but assumed the issue was from the eg and not the subprocess output. I have adjusted all my scripts with this code, and now my system is finally integrated!!
Is it possible to spawn the python scripts so that EG doesn't pause while subprocess and sleep commands are processing?
thank you very much for the assistance!
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Python window control?
Of course, it is quite often the case.sideone wrote:Is it possible to spawn the python scripts so that EG doesn't pause while subprocess and sleep commands are processing?
You need threading.
Here is an example:
Code: Select all
from threading import Thread
from time import sleep
def time_consumingScript(var1, var2, var3):
print "############################################ Thread start"
print "%s + %s =" % (str(var2),str(var3)), var2 + var3
sleep(var1)
print "############################################ Thread stop"
t = Thread(target = time_consumingScript, args = [20, 3, 7])
t.start()