Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用python编写html文件时遇到问题_Python_Html - Fatal编程技术网

用python编写html文件时遇到问题

用python编写html文件时遇到问题,python,html,Python,Html,我很难用python编写一个非常简单的html文件 代码是: filehtml = 'C:\pathhere\helloworld.html' message = '''<html> <head></head> <body><p><Hello World!</p></body> </html>''' f = open(filehtml,'w') f.write(message) f.clos

我很难用python编写一个非常简单的html文件

代码是:

filehtml = 'C:\pathhere\helloworld.html'

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

f = open(filehtml,'w')
f.write(message)
f.close()
filehtml='C:\pathhere\helloworld.html'
消息=“”

您有一个额外的
在记事本中打开该文件以查看其是否正确写入ybtw,您应该使用
-syntax标记关闭,因为这是我现在看到的查找我的打字错误问题,对不起!我读了很多遍,都是在喝咖啡之前。
filehtml = 'C:\pathhere\helloworld.html'

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

f = open(filehtml,'w')
f.write(message)
f.close()