我正在尝试将用户输入例如用户输入widgetName添加到输出到<title>html 中的标记之间的文件中。我尝试查找如何执行此操作,但没有运气。widgetName = input("Please enter the name you would like to use for your widget: ")with open(os.path.join(widgetname, 'LockBackground.html'), 'w') as f: f.write("""<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title> USER INPUT GOES HERE!! </title><style type="text/css">@font-face { font-family: HelveticaNeue-UltraLigCond; src: url('fonts/font-file-goes-here');}# More CSS goes here.</style><script type="text/javascript" src="scripts/jquery-1.6.4.min.js"></script># More javascript here.</head><body># Code goes here.</body></html> """)
添加回答
举报
0/150
提交
取消