第一个网站

excel转为csv文件:

 将上面的csv文件转为html文件:

file:///C:/Users/%E5%93%88%E5%93%88/AppData/Local/kingsoft/WPS%20Cloud%20Files/userdata/qing/filecache/%E3%80%82%E3%80%82%E3%80%82%E7%9A%84%E4%BA%91%E6%96%87%E6%A1%A3/Python%E6%88%90%E7%BB%A9%E7%99%BB%E8%AE%B0%E4%BF%A1%E8%AE%A111.htm

 运用python CGI将上面的csv文件用网页表示:

 代码:

#-*-encoding:utf-8-*-
import csv
#读取csv文件
print('Content-type:text/html\n\n')
with open("D:\www\cgi-bin\Python成绩登记信计11.csv", "r") as f:
    reader = csv.reader(f)
    for row in reader:
        print(row)
        print("\n")

猜你喜欢

转载自www.cnblogs.com/ghh0/p/12951437.html