I am using the following code:
import subprocess
#subprocess.call(["cat","contents.txt"])
command = "VAR=$(cat contents.txt | grep token)"
subprocess.call(command, shell = True)
subprocess.call(["echo","$VAR"])
I am trying to assign value of token present in contents.txt to a variable and i am trying to print the variable. But i am not getting anything. What corrections can be done here.
Thanks
os.environ