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> """)