I am trying to call a python script before a build the firmware.
First I tried the following command:
But it only works if I write the full path to python.exe, e.g.
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python.exe …
This is bad for portability, since a other developer may use a different python installation.
The full path is set within the environment variable PATH and cmd.exe can execute it.
Are there anything left I have to consider?
Please try using the $() syntax with environment variables (e.g. $(ProgramFiles) or simply define your own variable).
Also VisualGDB will automatically install Python to $(LOCALAPPDATA)\VisualGDB\Python if you create a project using mbed, esp-idf or nRFConnect, so you can try referencing that Python installation instead.