PlatformIO Community

How to run my own Python script with arguments and flash an additional partition on the device?

Hello!
I successfully migrated the popular project Ka-Radio32 to the esp-idf platform for PlatformIO.
There are actions in the Ka-Radio32 project that the user must perform before uploading into the device.
Running python script with arguments, e.g.:

python ./nvs_partition_gen.py wrover.csv build/wrover.bin 0x2000

As a result, a binary file will be created, which must be downloaded to the device at the specified address. In an mingw32 environment, it looks like this (final download to device), e.g.:

python /home/yourhome/esp/esp-idf/components/esptool_py/esptool/esptool.py \
	--chip esp32 --port com5 --baud 460800 --before default_reset \
	--after hard_reset write_flash -u --flash_mode dio \
	--flash_freq 40m --flash_size detect \
	0x1000 /home/yourhome/esp/Ka-Radio32/build/bootloader/bootloader.bin \
	0x10000 /home/yourhome/esp/Ka-Radio32/build/KaRadio32.bin \
	0x8000 /home/yourhome/esp/Ka-Radio32/build/partitions.bin \
	0x3a2000 /home/yourhome/esp/Ka-Radio32/build/wrover.bin

How do I complete and automate all these steps in a PlatformIO environment?
Using mingw32 is very tiring.
I know that exists extra_script.py. But my knowledge of Python is below zero.
Please help solve the problem.
PlatformIO The best development environment, but very difficult to understand at implement tasks.
Thank you very much in advance.

Do you mean this https://docs.platformio.org/en/latest/projectconf/advanced_scripting.html#custom-upload-tool?

Sounds like an option, but I have absolutely no Python programming skills.