Using Python server to run d3js code from local Windows directory

Some of the d3js code samples may produce errors in certain browsers when you try to run static files locally.
You can run python’s simplehttpserver while browsing the samples.

  1. Open up a new Command Prompt window:
    1. WinKey+R
    2. Input “cmd“.
    3. Enter
  2. Via the command line, navigate into the directory that you want served. For example, if your project folder is in your c:tmp folder, you could type:
    cd c:tmp
  3. To start the HTTP server type:
    python -m SimpleHTTPServer 8888 &
  4. To stop the HTTP server from the Command Prompt use the keyboard command Ctrl+C (⌃+C)
  5. Switch back to your web browser and visit the following URL: http://localhost:8888/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s