how to use termux commands between python script

1.1k views Asked by At

i have written a python script which takes a multi line input from user and displays multi line output.

i generally paste the input when i use pydroid3 and copy the output

i recently installed termux and i am looking towards automating my script like when i execute this

$ python script.py command, the input should be automatically drawn from clipboard using termux-clipboard-get and the final output from my python script should be copied to clipboard using termux-clipboard-set

1

There are 1 answers

0
bit817 On

you should use the os module.

import os
os.system('termux-clipboard-get')
os.system('termux-clipboard-set')

considering the termux-clipboard-set and termux-clipboard-get are shell/linux commands