ermi
ermi

Reputation: 51

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?

Upvotes: 0

Views: 89

Answers (1)

Red
Red

Reputation: 27577

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)

Upvotes: 1

Related Questions