Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a3e3e36d
Commit
a3e3e36d
authored
Jun 16, 2010
by
Senthil Kumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addressing RDM's review comments on the doc change.
parent
e55a2052
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
Doc/library/simplehttpserver.rst
Doc/library/simplehttpserver.rst
+7
-5
No files found.
Doc/library/simplehttpserver.rst
View file @
a3e3e36d
...
@@ -82,15 +82,16 @@ The :mod:`SimpleHTTPServer` module defines the following class:
...
@@ -82,15 +82,16 @@ 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
interfaces the :class:`SimpleHTTPRequestHandler` as a
example which
creates a server using the
Handler to the :mod:`BaseHTTPServer` module
.
:class:`SimpleHTTPRequestHandler` 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 the following manner in order to
setup a very basic web server serving files relative to the current directory.::
set up a very basic web server serving files relative to the current
directory.::
import SimpleHTTPServer
import SimpleHTTPServer
import SocketServer
import SocketServer
...
@@ -104,8 +105,9 @@ setup a very basic web server serving files relative to the current directory.::
...
@@ -104,8 +105,9 @@ setup a very basic web server serving files relative to the current directory.::
print "serving at port", PORT
print "serving at port", PORT
httpd.serve_forever()
httpd.serve_forever()
It can also be invoked directly using the ``-m`` switch of interpreter a with
:mod:`SimpleHTTPServer` module can also be invoked directly using the ``-m``
``port number`` argument.::
switch of interpreter with a ``port number`` argument. Similar to previous
example, this serves the files relative to the current directory.::
python -m SimpleHTTPServer 8000
python -m SimpleHTTPServer 8000
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment