import sys
import os
log = os.system('cat /var/log/demesg')
This code prints the file by running the shell script cat /var/log/dmesg
. However, it is not copied to the log. I want to use this data somewhere else or just print the data like print log.
How can I implement this?