Created
June 13, 2022 16:13
-
-
Save db93n2/a3794d266fa0098a7c82ac658b3b8203 to your computer and use it in GitHub Desktop.
(python, termux) run python scripts outside of the .termux/tasker folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/data/data/com.termux/files/usr/bin/python | |
import sys | |
import subprocess | |
file = sys.argv[1] | |
args = ' '.join(map(str, sys.argv[2:])) | |
subprocess.run(['python', file, args]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the termux plugin seems to return the stdout with a linefeed at the end and i cant figure out how to get rid of it so i made a task that runs the termux plugin and then trims any whitespace when anything is returned. its a bit easier to add/edit arguments since you can just put the python script path in the %par1 section and arguments in %par2
curl command to download it to your tasker folder: