Launching “py.exe” – Not found?

Sysprogs forums Forums VisualGDB Launching “py.exe” – Not found?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #36362
    Seidleroni
    Participant

    In my prebuild step, I want the pylauncher to run a python script. I seem to have to hardcode the py launcher’s directory for it to work by doing something like “C:\Windows\py.exe -3 pre_build.py” or something similar. However, that directory is in my %PATH% variable and I can verify that by running “echo $(Path)”.
    How can I have it run the py launcher without hardcoding the directory?

    #36365
    support
    Keymaster

    Hi,

    VisualGDB passes the file name and arguments directly to ProcessStartInfo, so the behavior regarding path, etc is defined by it. You can try calling this function directly with different combinations of parameters to see what works the best.

    #36370
    Seidleroni
    Participant

    Just in case someone needs this information in the future, what I did was this:

    Command: cmd.exe

    Arguments: /c py -3 “\_build\pre_build.py” (or whatever/wherever your python script is)

    The “/c” is essentially telling the command line to execute the string passed to it. In this way, it will search PATH for py.exe

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