python run subprocess and get output

Solutions on MaxInterview for python run subprocess and get output by the best coders in the world

showing results for - "python run subprocess and get output"
Amanda
26 Aug 2017
1import subprocess
2
3output = subprocess.check_output("cat /etc/os-release", shell=True)
4output = output.decode("utf-8")
5print("Version info: ",output)
Alina
07 Jan 2020
1Version info:  NAME="Arch Linux"
2PRETTY_NAME="Arch Linux"
3ID=arch
4BUILD_ID=rolling
5ANSI_COLOR="38;2;23;147;209"
6HOME_URL="https://www.archlinux.org/"
7DOCUMENTATION_URL="https://wiki.archlinux.org/"
8SUPPORT_URL="https://bbs.archlinux.org/"
9BUG_REPORT_URL="https://bugs.archlinux.org/"
10LOGO=archlinux