On Mon, 22 Aug 2022 at 13:41, Dan Stromberg <drsali...@gmail.com> wrote: > > > > On Sun, Aug 21, 2022 at 2:05 PM Chris Angelico <ros...@gmail.com> wrote: >> >> On Mon, 22 Aug 2022 at 05:39, simone zambonardi >> <simone.zambona...@gmail.com> wrote: >> > >> > Hi, I am running a program with the punishment subrocess.Popen(...) what I >> > should do is to stop the script until the launched program is fully open. >> > How can I do this? I used a time.sleep() function but I think there are >> > other ways. Thanks >> > >> >> First you have to define "fully open". How would you know? > > > If you're on X11, you could conceivably use: > xwininfo -tree -root >
That's only one possible definition: it has some sort of window. But to wait until a program is "fully open", you might have to wait past a splash screen until it has its actual application window. Or maybe even then, it's not ready for operation. Only the OP can know what defines "fully open". ChrisA -- https://mail.python.org/mailman/listinfo/python-list