We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我使用以下代码生成一个头部导航: from dominate.tags import * import dominate #' html_head def setHtmlHeader(obj,html_title): #' 添加 等头部信息 with obj.head: meta(charset="UTF-8") meta(name="viewport",content="width=device-width, initial-scale=1.0") title(html_title) link(rel="stylesheet",href="src/css/templatemo_main.css") print("ok") def setTitle(obj): #' 渲染标题栏 title_1=img(cls="logo4",src="src/pics/button.png") #title_1=h1("单细胞转录组测序分析报告") title_2=a(href="#1") title_3_1=div(style="float: left;",cls="aa") title_2.add(title_1) title_3_1.add(title_2) title_3_2=h1("单细胞转录组测序分析报告") title_4=div(cls="logo",style="width: 100%;") title_4.add(title_3_1) title_4.add(title_3_2) title_5=div(cls="navbar-header",style="position:fixed;") title_5.add(title_4) title_6=div(cls="navbar navbar-inverse",role="navigation") title_6.add(title_5) obj.add(title_6) def main(): html_title = "单细胞转录组测序分析报告" html_root=dominate.document(lang="en",doctype="") setHtmlHeader(html_root,html_title) setTitle(html_root) with open('E:/2023洛兮医疗/01.资料/05.html_test/03.reports_out/03.reports_out/test.html','w') as f: f.write(html_root.render()) 但是得到的网页却是乱码! 不知道是哪里出了问题...
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
可是把相同的html内容复制到test2.html中,打开又不是乱码
解决了,纯纯是中文编码的问题
No branches or pull requests
我使用以下代码生成一个头部导航:
![image](https://private-user-images.githubusercontent.com/83384997/265578405-27ee4202-ffce-4024-8e7f-4353b1798159.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2ODk1MTcsIm5iZiI6MTcxOTY4OTIxNywicGF0aCI6Ii84MzM4NDk5Ny8yNjU1Nzg0MDUtMjdlZTQyMDItZmZjZS00MDI0LThlN2YtNDM1M2IxNzk4MTU5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI5VDE5MjY1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZiMzNhNDE3ODAyYjAyYjhiZTYzOGZlMmU2ZTlmMmRiZGNhNDRmMmI5ODA3MzI0MWJkMmZhNzJjZTZiNTIzMGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.2csPiU0lT0Ai4sRkihSoy40S_T-m-1-QZp0xVUCIF_U)
from dominate.tags import *
import dominate
#' html_head
def setHtmlHeader(obj,html_title):
#' 添加 等头部信息
with obj.head:
meta(charset="UTF-8")
meta(name="viewport",content="width=device-width, initial-scale=1.0")
title(html_title)
link(rel="stylesheet",href="src/css/templatemo_main.css")
print("ok")
def setTitle(obj):
#' 渲染标题栏
title_1=img(cls="logo4",src="src/pics/button.png")
#title_1=h1("单细胞转录组测序分析报告")
title_2=a(href="#1")
title_3_1=div(style="float: left;",cls="aa")
title_2.add(title_1)
title_3_1.add(title_2)
title_3_2=h1("单细胞转录组测序分析报告")
title_4=div(cls="logo",style="width: 100%;")
title_4.add(title_3_1)
title_4.add(title_3_2)
title_5=div(cls="navbar-header",style="position:fixed;")
title_5.add(title_4)
title_6=div(cls="navbar navbar-inverse",role="navigation")
title_6.add(title_5)
obj.add(title_6)
def main():
html_title = "单细胞转录组测序分析报告"
html_root=dominate.document(lang="en",doctype="")
setHtmlHeader(html_root,html_title)
setTitle(html_root)
with open('E:/2023洛兮医疗/01.资料/05.html_test/03.reports_out/03.reports_out/test.html','w') as f:
f.write(html_root.render())
但是得到的网页却是乱码!
不知道是哪里出了问题...
The text was updated successfully, but these errors were encountered: