PlatformIO Community

env.Execute("foo.exe") , but DON'T wait for foo?

env.Execute(“foo.exe”) - any ideas how to launch foo.exe, but continue without waiting for foo.exe (or it’s children) to finish?

env.Execute is of course in extra_script.py. foo.exe happens to be a serial monitor, which is supposed to stay running… but env.Execute waits forever for foo.exe to exit. I’ve tried every manner of
“foo.exe”, or ,
env.Execute(“foo.bat”), which calls foo.exe, or,
env.Execute(“start foo.bat”), env.Execute(c:\windows\system32\cmd /C foo.exe) - /C /SEPARATE CALL START - I’ve tried everything: env.Execute stubbornly refuses to continue until everything exits. How can I get around this?

Scons’ env.Execute() call only seems to support blocking operations (refer https://scons.org/doc/2.2.0/HTML/scons-user/a11700.html).

In the python script, you may still use all of the python system libraries. One way to start a process and not waiting for it to finish is via the subprocess library and the Popen (process open) calls. See https://docs.python.org/3.4/library/subprocess.html and https://stackoverflow.com/questions/16071866/non-blocking-subprocess-call for reference.

1 Like