
以下のプログラムをwebサーバーで実行できません。
#!/usr/bin/env python
import datetime
import cgi
import cgitb
cgitb.enable()
http_body='''<html>
<head> <meta charset="UTF-8"/> <title>today's fortune</title> </head> <body> {month} is your birth month,today is {fortune} for you ! </body> </html>'''param_data=cgi.FieldStorage()
month=int(param_data.getvalue("month"))
today=datetime.date.today()
contents={}
contents["month"]=month
contents["fortune"]=["a happy day","a bad day","a brilliant day"]
[today.day * month % 6]
print("Content-type:text/html")
print("")
print(http_body.format(**contents))
__________________________________________
エラーコードは以下の通りです。
<ターミナル上>
raceback (most recent call last):
File "fortune_month.py", line 19, in <module>
month=int(param_data.getvalue("month"))
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
<webサーバー上>
Error code: 404
Message: No such CGI script ('/cgi-bin/fortune_month.py').
Error code explanation: HTTPStatus.NOT_FOUND - Nothing matches the given URI.
当方初学者です。よろしくお願いいたします。






