Code: Select all
os.environ['WINEPREFIX'] = '/some/path'
proc_wineserver = subprocess.Popen(
['wineserver', '-f', '-p'], # run persistent in foreground
stdin = subprocess.PIPE,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE,
shell = False
)
time.sleep(1) # Wait one second to ensure that wineserver is actually up and running. BETTER SOLUTION?
At the moment, I simply sleep for one second, which is odd on faster PCs and really not enough on somewhat older hardware (or with slow harddrives instead of SSDs). Not to mention that it looks stupid
Is there a signal I can catch or a file I can check (and wait for in a loop to appear) or anything else which would allow me a clean(er) solution?