Say I have the following HTML script:
<head>$name</head>
And I have the following shell script which replaces the variable in the HTML script with a name
#/bin/bash
report=$(cat ./a.html)
export name=$(echo aakash)
bash -c "echo \"$report\""
This works.
Now I have to implement the shell script in Python so that I am able to replace the variables in the HTML file and output the replaced contents in a new file. How do I do it?
An example would help. Thanks.
bashyou can convert it topythonand test that... probably should have posted your python attempt first.