1. Home
  2. Computing & Technology
  3. Python

Building a Simple Web Server in Python

From , former About.com Guide

4 of 10

Hosts and Ports

As already mentioned, the server needs to know the host to which it is to be associated and the port on which to listen. For our purposes, we shall have the service apply to any host name at all.

host = ''
port = 8080
The port, as mentioned earlier, will be 8080. So note that, if you use this server in conjunction with the network client, you will need to change the port number used in that program.

Explore Python
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Python
  4. Networking
  5. Python Web Server: Hosts and Ports

©2009 About.com, a part of The New York Times Company.

All rights reserved.