简体   繁体   中英

Convert a linux command to python command

Would you please say me how can I convert this code:

path to app/adb devices | awk 'NR>1{print $1}' | xargs -n1 -I% adb -s % install app.apk

to python command?

You can always utilize the os.system() method:

import os

command = "path to app/adb devices | awk 'NR>1{print $1}' | xargs -n1 -I% adb -s % install app.apk"

os.system(command)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM