Parameter for python script #439
-
For a bash script I can provide a parameter to run the script again with this parameter How can I provide a parameter for a python script with a menu entry? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
The |
Beta Was this translation helpful? Give feedback.
-
Got it! Is works! Thank you so much! But I guess it should note more precise in the description of the page here |
Beta Was this translation helpful? Give feedback.
-
To pass a parameter to a Python script from a menu entry (like in BitBar/SwiftBar or similar tools), you need to include the parameter in the bash call, just like you would for a Bash script. Here's how you do it for a menu entry calling a Python script with parameters: 🧾 Menu Entry Example (e.g., for SwiftBar/BitBar) echo "$name ($ip) | bash='python3' param1='/path/to/script.py' param2='--terminal' param3='false' refresh=true checked=true" |
Beta Was this translation helpful? Give feedback.
bash
- Absolute file path, executable script to run in ShellThe
bash
(orshell
) parameter referes to a script that will be executed, andparamN
s are the parameters(args) that will be passed to it.