@@ -82,34 +82,35 @@ The :mod:`SimpleHTTPServer` module defines the following class:
82
82
``text/ `` the file is opened in text mode; otherwise binary mode is used.
83
83
84
84
The :func: `test ` function in the :mod: `SimpleHTTPServer ` module is an
85
- example which creates a server using the
86
- :class: ` SimpleHTTPRequestHandler ` as the Handler.
85
+ example which creates a server using the :class: ` SimpleHTTPRequestHandler `
86
+ as the Handler.
87
87
88
88
.. versionadded :: 2.5
89
89
The ``'Last-Modified' `` header.
90
90
91
91
92
- The :mod: `SimpleHTTPServer ` module can be used the following manner in order to
93
- set up a very basic web server serving files relative to the current
94
- directory.::
92
+ The :mod: `SimpleHTTPServer ` module can be used in the following manner in order
93
+ to set up a very basic web server serving files relative to the current
94
+ directory. ::
95
95
96
- import SimpleHTTPServer
97
- import SocketServer
96
+ import SimpleHTTPServer
97
+ import SocketServer
98
98
99
- PORT = 8000
99
+ PORT = 8000
100
100
101
- Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
101
+ Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
102
102
103
- httpd = SocketServer.TCPServer(("", PORT), Handler)
103
+ httpd = SocketServer.TCPServer(("", PORT), Handler)
104
104
105
- print "serving at port", PORT
106
- httpd.serve_forever()
105
+ print "serving at port", PORT
106
+ httpd.serve_forever()
107
107
108
- :mod: `SimpleHTTPServer ` module can also be invoked directly using the ``-m ``
109
- switch of interpreter with a ``port number `` argument. Similar to previous
110
- example, this serves the files relative to the current directory.::
108
+ The :mod: `SimpleHTTPServer ` module can also be invoked directly using the
109
+ :cmdoption: `-m ` switch of the interpreter with a ``port number `` argument.
110
+ Similar to the previous example, this serves the files relative to the
111
+ current directory. ::
111
112
112
- python -m SimpleHTTPServer 8000
113
+ python -m SimpleHTTPServer 8000
113
114
114
115
.. seealso ::
115
116
0 commit comments