Executing python scripts from a patcher

    Misc

    jon snow
    Nov 15 2023 | 8:09 pm
    Hello everyone I need some support making a patch that could launch python scripts.
    I am using the "shell" object by jeremybernstein (https://github.com/jeremybernstein/shell) but I can't make it change directory.
    The "cd" command seems not to work, as the working directory doesn't change.
    Anyway, if I move the scripts in the working folder, it still doesn't work. A sample command like "python3 /Users/username/hello.py", for instance.
    Has anyone experienced such a thing?
    Thank you

    • Source Audio's icon
      Source Audio
      Nov 16 2023 | 7:27 am
      either enter absolute path to pyhon in slash format, or try wd attribute in shell (working directory)
      Share
    • pdelges's icon
      pdelges's icon
      pdelges
      Nov 16 2023 | 7:44 am
      With a script called "ws2sc.py" in the same folder as the Max patch, the following patch works for me:
      Max Patcher
      In Max, select New From Clipboard.
      Show Text
    • jon snow's icon
      jon snow's icon
      jon snow
      Nov 20 2023 | 4:17 pm
      Ok, now I can run the python snippet, but what if there are some arguments to pass through? The command should be like "code.py --file_name hello --duration 2"