我的HTML代碼:如何HTML表單數據存儲到文件
<html>
<head>
<title>INFORMATION</title>
</head>
<body>
<form action = "/cgi-bin/test.py" method = "post">
FirstName:
<input type = "text" name = "firstname" /><br>
LastName:
<input type = "text" name = "lastname" /><br>
<input type = "submit" name = "submit "value = "SUBMIT">
<input type = "reset" name = "reset" value = "RESET">
</form>
</body>
我的Python代碼(test.py),這是在cgi-bin目錄:
#!usr/bin/python
form = web.input()
print form.firstname
print form.lastname
什麼我應該如何將html數據存儲在某個文件中?
重複http://stackoverflow.com/questions/13451400/saving-data-to-txt-file-using-python – shankar