[Tasker Tips & Tricks] JayShortway:
Hi,

To my understanding, the pipe ('|') symbol in the command takes the output of the curl command and sends it as input to Python. So, when you execute the command on your Ubuntu terminal, it downloads the dash.py script from 192.168.1.9 (Raspberry Pi, I assume?) and executes it using Python on your Ubuntu terminal, as far as I know.

You can use Tasker's HTTP Get to download the dash.py script to your phone, and then you would need to use Scripting Layer for Android (SL4A) with Python for Android to execute the dash.py script on your phone. If the dash.py script has a lot of dependencies (Modules), this probably won't work. If the dash.py script doesn't change, you don't have to download it each time, so you can just keep the dash.py file on your phone.

However, this is not very elegant, as the script is executed on your phone each time. Alternatively, you could execute dash.py on your Raspberry Pi, possibly triggered from your phone using Tasker and AutoRemote (h t t p s://youtu.be/1F8XvdrrdIE), for example.

Anyway, here's how to download dash.py to your phone and execute it on your phone:

(This involves installing APKs from unknown sources, so that's your own risk. Make sure 'Unknown Sources' is enabled in your phone's settings.)

Keep in mind, if the dash.py script has a lot of dependencies (Modules), this probably won't work.

Download and install SL4A from h t t p s://github.com/kuri65536/sl4a/releases

Scroll to find the correct version of sl4a-r*-debug.apk for your phone (probably armv7 or arm).

If you're on Android 6.0+, revoke any permissions you don't need, but keep the Storage permission.

Download and install Python for Android from h t t p s://github.com/kuri65536/python-for-android/releases

Depending on whether dash.py is written for Python 2.* or Python 3.*, you would need PythonForAndroid-debug-r*.apk or Python3ForAndroid-debug-r*.apk, respectively.

Scroll to find it.

Launch Python for Android, and press 'Install'.

Launch SL4A. You should see a list of Python scripts. Tap one to check if it works (say_time.py for example).

Now for the Tasker part, create the following task:

Net --> HTTP Get (only necessary once if dash.py never changes)

Server:Port: h t t p ://192.168.1.9

Path: /scripts/dash.py

Output File: sl4a/scripts/dash.py

Run it once, so dash.py is on your phone. (If dash.py never changes, you can disable this Action after you ran it once.)

To have the script be executed in the foreground, add this Action:

Plugin --> SL4A

Tap dash.py

To have the script be executed in the background instead, add this Action:

System --> Send Intent

(Make sure there are no spaces in any of the values.)

Action: com.googlecode.android_scripting.action.LAUNCH_BACKGROUND_SCRIPT

Extra: com.googlecode.android_scripting.extra.SCRIPT_PATH:storage/emulated/0/sl4a/scripts/dash.py

Package: com.googlecode.android_scripting

Class: com.googlecode.android_scripting.activity.ScriptingLayerServiceLauncher

Target: Service (Activity also works)

That's it! The Tasker task isn't very extensive, only one Action (Either 'Plugin --> SL4A' or 'System --> Send Intent') if dash.py only needs to be downloaded once.

I hope this is useful to you!