from subprocess import run def install(args): CMD=''' sudo bluetoothctl <<EOF power on discoverable on pairable on EOF ''' run(CMD, shell=True)