Use python to execute shell command and redirect the output to a variable
Use python to execute shell command and redirect the output to a variable Question: I am trying to do 2 things with Python- Execute a command at the terminal Save the output of the above command to a variable. This is my code till now – import subprocess ip_address = "http://ipwho.is/104.123.204.11" query_reply = subprocess.run(["curl" , …