如何用python写一段浪漫的代码

2025-05-14 15:58:23
推荐回答(1个)
回答(1):

简单的,可以使用python 的CGI模块,需要你的服务器开启CGI支持。
网页内容如下:
1
2
3
4
5
6
7
8
9
10
11



python cgi

输入登录密码:



密 码:






login.py文件内容如下:
1
2
3
4
5
6
7
8
9
#!/usr/bin/python
#coding:utf-8
import cgi
form = cgi.FieldStorage()
ma = ""
if 'ma' in form:
ma = form["ma"].value
print '''Content-Type: text/html\n\n'''
print ''' python cgi

你输入的密码是:%s

''' % ma