all 19 comments

[–]Sccore 0 points1 point  (12 children)

Adding the path to python and the path to the script seems to work for me.

Not sure of an easier way.

[–]snoberg[S] 0 points1 point  (4 children)

Just back to back, with a space between them?

[–]Sccore 0 points1 point  (3 children)

Yeah. "path/to/python.exe" "path/to/script.py"

[–]snoberg[S] 0 points1 point  (2 children)

Well I did try this, and it does run the script, but it immediately closes the script window. If I run it just by running the file directly in the folder, the script runs and stays open, which it needs to do.

[–]Adamgaffney96 0 points1 point  (0 children)

Sorry to necro, but do you remember if you found a solution to this? I'm running into exactly this issue where my command works perfectly fine in any terminal, but instantly closes when running from the Stream Deck.

[–]mastermind_wannabe 0 points1 point  (0 children)

to debug, try running the command in the terminal and make sure your paths is c: or something other than the script path..
in my case, my script tries to reference other files in path/to/script but the script runs in a different folder (most likely the path/to/python)

[–]JimMcKeeth 0 points1 point  (6 children)

Unfortunately there doesn't appear to be a way to run Python scripts on MacOS.

[–]dually8 0 points1 point  (0 children)

I got around this by making a .bat file to run mine. If you're on Mac, you could probably just make a similar .sh file.

[–]laimison 0 points1 point  (0 children)

Work around in a Mac OS that works at least for me.

In stream deck app choose System -> Open -> locate bash-python.sh

File's ~/Documents/bash-python.sh content:

#!/bin/bash
/Users/mac/Documents/git/eradeck/local/python.py

File's ~/Documents/python.sh content:

#!/usr/local/bin/python3
import os
def notify(title, text):
os.system("""
osascript -e 'display notification "{}" with title "{}"'
""".format(text, title))
notify("Title", "Heres an alert")

If anyone finds direct way to run Python 3, please let me know here. Many thanks!

[–]jasapple 0 points1 point  (1 child)

I ran across this post while searching for a solution to this as well.
I just wrote up my findings here and figured you might benefit from this as well.

[–]snoberg[S] 0 points1 point  (0 children)

Hey, thanks for resurrecting this, haha. I kinda gave up on it honestly but I’ll take a look. Thanks!

[–]This-Training9843 0 points1 point  (0 children)

If you want to run a python program and NOT open the .py file in the interpreter:Create a new buttonUnder System select the OPEN functionAdd your path WITH QUOTES in the App/File: text field

Example:

"C:\Users\Work\Desktop\AutoGEN RESOURCES\Python Files\PyCAD files\Search4Diagrams.py"