Commit 0ada39cd authored by Georg Brandl's avatar Georg Brandl

Grammar and markup fixes.

parent 8a08ce25
...@@ -82,34 +82,35 @@ The :mod:`SimpleHTTPServer` module defines the following class: ...@@ -82,34 +82,35 @@ The :mod:`SimpleHTTPServer` module defines the following class:
``text/`` the file is opened in text mode; otherwise binary mode is used. ``text/`` the file is opened in text mode; otherwise binary mode is used.
The :func:`test` function in the :mod:`SimpleHTTPServer` module is an The :func:`test` function in the :mod:`SimpleHTTPServer` module is an
example which creates a server using the example which creates a server using the :class:`SimpleHTTPRequestHandler`
:class:`SimpleHTTPRequestHandler` as the Handler. as the Handler.
.. versionadded:: 2.5 .. versionadded:: 2.5
The ``'Last-Modified'`` header. The ``'Last-Modified'`` header.
The :mod:`SimpleHTTPServer` module can be used the following manner in order to The :mod:`SimpleHTTPServer` module can be used in the following manner in order
set up a very basic web server serving files relative to the current to set up a very basic web server serving files relative to the current
directory.:: directory. ::
import SimpleHTTPServer import SimpleHTTPServer
import SocketServer import SocketServer
PORT = 8000 PORT = 8000
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler) httpd = SocketServer.TCPServer(("", PORT), Handler)
print "serving at port", PORT print "serving at port", PORT
httpd.serve_forever() httpd.serve_forever()
:mod:`SimpleHTTPServer` module can also be invoked directly using the ``-m`` The :mod:`SimpleHTTPServer` module can also be invoked directly using the
switch of interpreter with a ``port number`` argument. Similar to previous :cmdoption:`-m` switch of the interpreter with a ``port number`` argument.
example, this serves the files relative to the current directory.:: Similar to the previous example, this serves the files relative to the
current directory. ::
python -m SimpleHTTPServer 8000 python -m SimpleHTTPServer 8000
.. seealso:: .. seealso::
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment