Forums

Getting weird error message. Content of message not supposed to be string.

write-html.py

f = open('helloworld.html', 'wb')

message = """<html>
<head></head>
<body><p>Hello World!</p></body>
</html>"""

f.write(message)
f.close()

This code works at every site and on my MacBook pro, but not here at Python anywhere. Why? When i run this file it generates an empty file. I can't get Hello world or the HTML to be placed inside the file.

replied to your second post here that contains the error message