Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
コマンドを使用して http サーバーを起動すると、次のようになります。
python -m SimpleHTTPServer
デフォルトの 404 ページを変更するにはどうすればよいですか?
コマンドラインでは、それは不可能です。
次のようなスクリプトを作成する必要があります。
import BaseHTTPServer import SimpleHTTPServer class MyHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): error_message_format = ''' custom error message ''' BaseHTTPServer.test(MyHandler, BaseHTTPServer.HTTPServer)