d
Amit DhamuSoftware Engineer
 

Write File Contents in Python

1 minute read 00000 views
with open("index.html", "w") as w:
    w.write("""\
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Homepage</title>
    </head>
    <body>
        <h1>Hello</h1>
    </body>
</html>
""")