PlatformIO Community

Python script for building multiple environments

Hi,

I have a platform io project for Arduino with many environments.
I am trying to create a small python script, that builds all the environments and put the complication in a target folder with custom names.

I already face a fundamental problem, when calling pio in python: the command is not available. Though, calling pio in shell is working.
Is it possible to directly control platformio from a python script, or do I have to pass the command to the shell from my script.

Thanks

You can make the pio command available in the shell as documented in

https://docs.platformio.org/en/latest/core/installation.html#install-shell-commands

You can also call directly into ~/.platformio/penv/bin/platformio (If I remember the path correctly, but it’s somewhere in ~/.platformio).

Thanks :slight_smile: I am going to do it like this