My question is, how do I take two different user input in Python and write them to an HTML file, so that when I open the file, it will display the user's input?
I am not looking to open the HTML file in the browser from Python. I just want to know how to pass Python input to the HTML file and how exactly that output must be coded into HTML.
This is the code:
name = input("Enter your name here: ")
persona = input("Write a sentence or two describing yourself: ")
with open('mypage.html', "r") as file_object:
data = file_object.read()
print(data)
I want to take the name input and persona input and pass it to a HTML file, open the file manually, and see it display as a webpage. The output would look something like this when I open the file:
<html>
<head>
<body>
<center>
<h1>
... Enter user name here... # in which i don't know how to print python user
# input into the file
</h1>
</center>
<hr />
... Enter user input here...
<hr />
</body>
</html>