so in PHP it's possible to have an entire section of php source be filled with direct raw html:
<?php
function doThis(){
?>
<html>
<a>LOOL</a>
</html>
<?php
}
doThis();
?>
and calling doThis() will print out all the html code between the curly braces...is there a similar functionality in Python? or do I have to virtually print all the HTML individually using the print command? python's indentation seems to make it really inconvenient to write HTML on python code
I'm not certain I fully understand your question, but if you need to have long blocks of arbitrary text in Python the best way I've found is like so:
myHTML = """
<html>
<head>
<title>I am an HTML Page<title>
<head>
<body>
<div>Some content here.</div>
</body>
</html>
"""
The key is the triple Quotes. It allows you to put any other content between them, including line breaks, spacing, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With