check whether poll(returns none it shouldas the process is still running then we close the ms paint program and call wait(on the terminated process now wait(and poll()return indicating that the process terminated without errors note unlike mspaint exeif you run calc exe on windows using subprocess popen()you'll notice that wait(instantly returns even though the calculator app is still running this is because calc exe launches the calculator app and then instantly closes itself windowscalculator program is "trusted microsoft store app,and its specifics are beyond the scope of this book suffice it to sayprograms can run in many applicationand operating system-specific ways passing command line arguments to the popen(function you can pass command line arguments to processes you create with popen(to do soyou pass list as the sole argument to popen(the first string in this list will be the executable filename of the program you want to launchall the subsequent strings will be the command line arguments to pass to the program when it starts in effectthis list will be the value of sys argv for the launched program most applications with graphical user interface (guidon' use command line arguments as extensively as command line-based or terminalbased programs do but most gui applications will accept single argument for file that the applications will immediately open when they start for exampleif you're using windowscreate simple text file called :\users \al\hello txt and then enter the following into the interactive shellsubprocess popen([' :\\windows\\notepad exe'' :\\users\al\\hello txt']this will not only launch the notepad application but also have it immediately open the :\users\al\hello txt file task schedulerlaunchdand cron if you are computer savvyyou may know about task scheduler on windowslaunchd on macosor the cron scheduler on linux these well-documented and reliable tools all allow you to schedule applications to launch at specific times if you' like to learn more about themyou can find links to tutorials at using your operating system' built-in scheduler saves you from writing your own clock-checking code to schedule your programs howeveruse the time sleep(function if you just need your program to pause briefly or instead of using the operating system' scheduleryour code can loop until certain date and timecalling time sleep( each time through the loop