From c9f2f048b54c4497c035b22b9dd031f4505f2f16 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Tue, 30 Jun 2009 09:03:15 -0400 Subject: [PATCH] cycle through image servers --- dip2 | 6 +----- installing-python.html | 27 +++++++++++++++++++++++++-- publish | 3 ++- util/htmlminimizer.py | 14 +++++++++++++- 4 files changed, 41 insertions(+), 9 deletions(-) diff --git a/dip2 b/dip2 index c73b8c0..9e7277d 100644 --- a/dip2 +++ b/dip2 @@ -9,12 +9,8 @@ of other platforms you've probably never even heard of.

What's more, Python programs written on one platform can, with a little care, run on any supported platform. For instance, I regularly develop Python programs on Windows and later deploy them on Linux.

So back to the question that started this section, “Which Python is right for you?” The answer is whichever one runs on the computer you already have. +

1.2. Python on Windows

-

On Windows, you have a couple choices for installing Python. -

ActiveState makes a Windows installer for Python called ActivePython, which includes a complete version of Python, an IDE with a Python-aware code editor, plus some Windows extensions for Python that allow complete access to Windows-specific services, APIs, and the Windows Registry. -

ActivePython is freely downloadable, although it is not open source. It is the IDE I used to learn Python, and I recommend you try it unless you have a specific reason not to. One such reason might be that ActiveState is generally -several months behind in updating their ActivePython installer when new version of Python are released. If you absolutely need the latest version of Python and ActivePython is still a version behind as you read this, you'll want to use the second option for installing Python on Windows. -

The second option is the “official” Python installer, distributed by the people who develop Python itself. It is freely downloadable and open source, and it is always current with the latest version of Python.

Procedure 1.1. Option 1: Installing ActivePython

Here is the procedure for installing ActivePython: diff --git a/installing-python.html b/installing-python.html index f01eedc..61afa4f 100644 --- a/installing-python.html +++ b/installing-python.html @@ -16,14 +16,24 @@ body{counter-reset:h1 0}

Difficulty level: ♦♢♢♢♢

Installing Python

-

FIXME
— FIXME +

Tempora mutantur nos et mutamur in illis. (Times change, and we change with them.)
— ancient Roman proverb

 

Diving in

-

FIXME +

Welcome to Python 3. Let's dive in. In this chapter, you'll install the version of Python 3 that's right for you. + +

Which Python Is Right For You?

+ +

The first thing you need to do with Python is install it. Or do you? + +

If you're using an account on a hosted server, your ISP may have already installed Python 3. Most popular GNU/Linux distributions come with Python 2 in the default installation; a small but growing number of distributions also include Python 3. (As you’ll see in this chapter, you can have more than one version of Python installed on your computer.) Mac OS X includes a command-line version of Python 2, although you'll probably want to install a version that includes a more Mac-like graphical interface. +

Windows does not come with any version of Python, but don’t despair! There are several ways to point-and-click your way to Python on Windows. +

What's more, Python programs written on one platform can run on any supported platform. For instance, I regularly develop Python programs on Windows and later deploy them on Linux. +

So back to the question that started this section, “Which Python is right for you?” The answer is whichever one runs on the computer you already have.

Installing on Microsoft Windows

+

FIXME

[Windows dialog: open file security warning]

[Python installer: select whether to install Python 3.1 for all users of this computer]

[Python installer: select destination directory] @@ -36,6 +46,7 @@ body{counter-reset:h1 0}

Installing on Mac OS X

+

FIXME

[contents of Python installer disk image]

[Python installer: welcome screen]

[Python installer: information about supported architectures, disk space, and acceptable destination folders] @@ -52,6 +63,7 @@ body{counter-reset:h1 0}

Installing on Ubuntu Linux

+

FIXME

[Add/Remove: Canonical-maintained applications]

[Add/Remove: all open source applications]

[Add/Remove: search for Python 3] @@ -68,6 +80,17 @@ body{counter-reset:h1 0}

FIXME +

Python Editors and IDEs

+ +

FIXME +

+http://wiki.python.org/moin/PythonEditors
+http://wiki.python.org/moin/IntegratedDevelopmentEnvironments
+http://pydev.sourceforge.net/
+http://www.activestate.com/komodo/
+http://www.activestate.com/activepython/
+
+

© 2001–9 Mark Pilgrim diff --git a/publish b/publish index ff051d1..14dd54f 100755 --- a/publish +++ b/publish @@ -74,5 +74,6 @@ chmod 644 build/*.html build/*.css build/examples/*.py build/examples/*.txt buil # ship it! echo "publishing" +rsync -essh -avz build/i/* build/i/.htaccess diveintomark.org:~/web/wearehugh.com/dip3/ rsync -essh -avz build/j/$revision.js build/j/html5.js build/j/.htaccess diveintomark.org:~/web/diveintopython3.org/j/ -rsync -essh -avz build/*.html build/examples build/*.txt build/i diveintomark.org:~/web/diveintopython3.org/ +rsync -essh -avz build/examples build/*.txt build/*.html diveintomark.org:~/web/diveintopython3.org/ diff --git a/util/htmlminimizer.py b/util/htmlminimizer.py index 3e12ea2..de5947d 100644 --- a/util/htmlminimizer.py +++ b/util/htmlminimizer.py @@ -1,12 +1,24 @@ """Quick-and-dirty HTML minimizer""" -import sys, re, html.entities +import sys +import re +import html.entities +import itertools +_SERVERS = ['a.wearehugh.com', + 'b.wearehugh.com', + 'c.wearehugh.com', + 'd.wearehugh.com'] +available_server = itertools.cycle(_SERVERS) input_file = sys.argv[1] output_file = sys.argv[2] in_pre = False out = open(output_file, 'w', encoding="utf-8") # encoding argument! important! for line in open(input_file, encoding="utf-8").readlines(): + # round-robin image servers + if "