Python scripts in custom build steps

Sysprogs forums Forums VisualGDB Python scripts in custom build steps

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #29710
    mgandler
    Participant

    Hi,

    I am trying to call a python script before a build the firmware.
    First I tried the following command:
    python.exe “$(DOCUMENTS_ROOT)\Firmware\Scripts\create_generic_entries.py”

    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?

    #29712
    support
    Keymaster

    Hi,

    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.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.