5、用python寫一個自己的網頁


1、新建一個文件夾 ,在里面新建一個文件cgi–bin的文件

2、插入代碼;

print ("Content-type:text/html")
print ()
print ('<html>')
print ('<head>')
print ('<meta charset="gb2312">')
print ('<title>Hello Word- 我的第一個 CGI 程序!</title>')
print ('</head>')
print ('<body>')
print ('<h2>Hello Word! 123456</h2>')
print ('</body>')
print ('</html>')

3、在cmd按順序寫下如下代碼:

4、然后在電腦網頁輸入如下鏈接:http://localhost:8081/cgi-bin/111.py

結果如下:

 

哈哈完成啦,耶


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM