diff options
author | Georg Brandl <georg@python.org> | 2010-07-02 07:41:51 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-07-02 07:41:51 (GMT) |
commit | 8971f74c55112c848d2edaa584304066235ffd44 (patch) | |
tree | b8f412873a0422408897a7013975ad4259d6fcd6 /Doc/library/http.server.rst | |
parent | 963babcd0576f21dabc8b62a2aaf30df2b74c388 (diff) | |
download | cpython-8971f74c55112c848d2edaa584304066235ffd44.zip cpython-8971f74c55112c848d2edaa584304066235ffd44.tar.gz cpython-8971f74c55112c848d2edaa584304066235ffd44.tar.bz2 |
Merged revisions 82433 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r82433 | georg.brandl | 2010-07-02 09:33:50 +0200 (Fr, 02 Jul 2010) | 1 line
Grammar and markup fixes.
........
Diffstat (limited to 'Doc/library/http.server.rst')
-rw-r--r-- | Doc/library/http.server.rst | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst index 5fdb543..4bf5178 100644 --- a/Doc/library/http.server.rst +++ b/Doc/library/http.server.rst @@ -284,30 +284,30 @@ of which this module provides three different variants: For example usage, see the implementation of the :func:`test` function invocation in the :mod:`http.server` module. -The :class:`SimpleHTTPRequestHandler` class can be invoked the following manner -with the :mod:`http.server` to create a very basic webserver serving files -relative to the current directory.:: - import http.server - import socketserver +The :class:`SimpleHTTPRequestHandler` class can be used in the following +manner in order to create a very basic webserver serving files relative to +the current directory. :: - PORT = 8000 + import http.server + import socketserver - Handler = http.server.SimpleHTTPRequestHandler + PORT = 8000 - httpd = socketserver.TCPServer(("", PORT), Handler) + Handler = http.server.SimpleHTTPRequestHandler - print("serving at port", PORT) - httpd.serve_forever() + httpd = socketserver.TCPServer(("", PORT), Handler) -:mod:`http.server` can also be invoked directly using the ``-m`` switch of -interpreter a with ``port number`` argument which uses -:class:`SimpleHTTPRequestHandler` as the default request Handler. Similar to -the previous example, even this serves files relative to the current -directory.:: + print("serving at port", PORT) + httpd.serve_forever() + +:mod:`http.server` can also be invoked directly using the :cmdoption:`-m` +switch of the interpreter a with ``port number`` argument. Similar to +the previous example, this serves files relative to the current directory. :: python -m http.server 8000 + .. class:: CGIHTTPRequestHandler(request, client_address, server) This class is used to serve either files or output of CGI scripts from the |