termux打开CodeEdit编辑代码

cooolr 于 2021-04-25 发布

xdg-open

#!/data/data/com.termux/files/usr/bin/python
import os
import sys
from subprocess import Popen,PIPE

filename = os.path.abspath(sys.argv[1])

p = Popen(["am","start","-n","com.rhmsoft.code/com.rhmsoft.code.MainActivity",f"content://{filename}"], stdout=PIPE,stdin=PIPE)
p.wait()