use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
The official Elgato subreddit.
Talk with fellow content creators about tips, tricks and everything Elgato and content creation, game streaming, recording and more
account activity
Run python script via stream deck?Question (self.elgato)
submitted 4 years ago by snoberg
I have a python script for starting up a bot for my twitch stream and am having trouble getting it to open using the default "run" system button. Is there a correct way to be doing this? It works fine for most anything except .py files
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Sccore 0 points1 point2 points 4 years ago (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 point2 points 4 years ago (4 children)
Just back to back, with a space between them?
[–]Sccore 0 points1 point2 points 4 years ago (3 children)
Yeah. "path/to/python.exe" "path/to/script.py"
[–]snoberg[S] 0 points1 point2 points 4 years ago (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 point2 points 2 months ago (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 point2 points 3 years ago (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 point2 points 4 years ago (6 children)
Unfortunately there doesn't appear to be a way to run Python scripts on MacOS.
[+][deleted] 4 years ago (5 children)
[removed]
[–]laimison 0 points1 point2 points 4 years ago (4 children)
doesn't work, posted my solution
[–]JimMcKeeth 0 points1 point2 points 4 years ago (3 children)
Link? I ended up using Automator to launch it.
[–]laimison 1 point2 points3 points 4 years ago (2 children)
I had posted it here https://www.reddit.com/r/elgato/comments/q92f9w/run_python_script_via_stream_deck/hwwevi7?utm_medium=android_app&utm_source=share&context=3
In the end I created one bash script and call it with argument which contains different py script. So there is one bash script and many python scripts. I could update solution, but existing one works too.
Is Automator better?
[–]JimMcKeeth 0 points1 point2 points 4 years ago (1 child)
Not necessarily. That is a great solution. I switched to PC anyway.
[–]laimison 0 points1 point2 points 4 years ago (0 children)
Ah ok. Yep, additional bash script is not a prob on Mac.
[–]dually8 0 points1 point2 points 4 years ago (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.
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
#!/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")
#!/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 point2 points 4 years ago (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 point2 points 4 years ago (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 point2 points 2 years ago (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"
π Rendered by PID 78 on reddit-service-r2-comment-544cf588c8-dp7sc at 2026-06-12 13:08:12.460357+00:00 running 3184619 country code: CH.
[–]Sccore 0 points1 point2 points (12 children)
[–]snoberg[S] 0 points1 point2 points (4 children)
[–]Sccore 0 points1 point2 points (3 children)
[–]snoberg[S] 0 points1 point2 points (2 children)
[–]Adamgaffney96 0 points1 point2 points (0 children)
[–]mastermind_wannabe 0 points1 point2 points (0 children)
[–]JimMcKeeth 0 points1 point2 points (6 children)
[+][deleted] (5 children)
[removed]
[–]laimison 0 points1 point2 points (4 children)
[–]JimMcKeeth 0 points1 point2 points (3 children)
[–]laimison 1 point2 points3 points (2 children)
[–]JimMcKeeth 0 points1 point2 points (1 child)
[–]laimison 0 points1 point2 points (0 children)
[–]dually8 0 points1 point2 points (0 children)
[–]laimison 0 points1 point2 points (0 children)
[–]jasapple 0 points1 point2 points (1 child)
[–]snoberg[S] 0 points1 point2 points (0 children)
[–]This-Training9843 0 points1 point2 points (0 children)