Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含九个数字的列表,我想将它们放入一个 html 中,例如 aList = [1,2,3,4,5,6,7,8,9]。所以在python中我想输入类似这样的东西 myPage.write("aList[0],aList[1],aList[2],blablabla") 显然它不起作用......那么有人可以帮助我吗?
您是否正在寻找类似的东西:
注意:这尚未经过测试。
def listToHTML(list): str = "<ul>" for elem in list: str += "<li>" + str(elem) + "</li>" str += "</ul>" return str