diff --git a/.htaccess b/.htaccess index 5480678..a6b38a2 100644 --- a/.htaccess +++ b/.htaccess @@ -1,19 +1,8 @@ SecFilterEngine off FileETag MTime Size -Header set Content-Style-Type "text/css" Options -Indexes DirectoryIndex index.html -AddType text/xsl .xslt -AddType application/xml .atom -AddType text/html .xo AddType text/plain .txt AddType text/plain .py -AddType video/mp4 .mp4 -AddType application/x-srt .srt -AddType video/ogg .ogv AddType image/x-icon .ico -AddType application/vnd.oasis.opendocument.presentation .odp AddDefaultCharset utf-8 -RemoveOutputFilter .js -SetEnvIfNoCase Request_URI \.js$ no-gzip dont-vary -SetEnvIfNoCase Request_URI \.mp4$ no-gzip dont-vary diff --git a/case-study-porting-chardet-to-python-3.html b/case-study-porting-chardet-to-python-3.html index 04a5530..f0955ac 100644 --- a/case-study-porting-chardet-to-python-3.html +++ b/case-study-porting-chardet-to-python-3.html @@ -3,17 +3,17 @@ Case study: porting chardet to Python 3 - Dive into Python 3 - + + + -

skip to main content -

-

Case study: porting chardet to Python 3

+

Words, words. They’re all we have to go on.
Rosencrantz and Guildenstern are Dead

diff --git a/dip3.css b/dip3.css index 6b2de62..4de2f62 100644 --- a/dip3.css +++ b/dip3.css @@ -7,13 +7,12 @@ a:link{color:#1b67c9} a:visited{color:darkorchid} h1 a,h2 a,h3 a,#nav a{color:inherit !important} abbr,acronym{letter-spacing:0.1em;text-transform:lowercase;font-variant:small-caps} -h1,h2,h3,p,ul,ol,#search{margin:1.75em 0} +h1,h2,h3,p,ul,ol,#search{margin:1.75em 0;font-size:medium} +h2,h3{clear:both} form div{float:right} -li ol{margin:0} -h1,h2,h3{font-size:medium;clear:both} -h1{background:papayawhip;color:#000;width:100%;margin:0} -pre{white-space:pre-wrap;margin:2.154em 0;padding:0 0 0 2.154em;border-left:1px dotted} -pre,kbd,code,samp{font-family:Consolas,Inconsolata,Monaco,monospace;font-size:medium;line-height:2.154;word-spacing:0} +form p,form h1{display:inline} +pre{white-space:pre-wrap;padding-left:2.154em;line-height:1.75;border-left:1px dotted} +pre,kbd,code,samp{font-family:Consolas,Inconsolata,Monaco,monospace;font-size:medium;word-spacing:0} pre a{padding:0.4375em 0;border:0} pre a:hover{border:0} .widgets,.widgets a{font-size:small} @@ -21,6 +20,7 @@ pre a:hover{border:0} kbd{font-weight:bold} .prompt{color:#667}/*the neighbor of the beast*/ td pre{margin:0;padding:0;border:0} +li ol{margin:0 inherit} .c{text-align:center;font-size:small} p.fancy:first-letter{float:left;background:transparent;color:gainsboro;padding:0.11em 4px 0 0;font:normal 4em/0.68 serif} blockquote.q{margin:auto;text-align:right;font-style:oblique} @@ -36,11 +36,11 @@ span,tr + tr th:first-child{font-family:'Arial Unicode MS',sans-serif;font-style .note{margin-left:4.94em} .note span{display:block;float:left;font-size:xx-large;line-height:0.875em;margin:0 0.22em 0 -1.22em} table.simple th{font-family:inherit !important} -.fr{width:100%;margin:2.154em 0;border:1px dotted} +.fr{width:100%;border:1px dotted} .fr h4{margin-top:-1.2em;margin-left:-1em;width:8.5em;border:1px dotted;padding: 3px 3px 3px 13px;background:#fff;color:inherit;position:relative} .hover{background:#eee !important;color:inherit !important;cursor:default !important} body{counter-reset:h1} -h1:before{counter-increment:h1;content:counter(h1) ". "} +h1:before{counter-increment:h1;content:"Chapter " counter(h1) ". "} h1{counter-reset:h2} h2:before{counter-increment:h2;content:counter(h1) "." counter(h2) ". "} h2{counter-reset:h3} diff --git a/index.html b/index.html index ae38c5c..06aaaf0 100644 --- a/index.html +++ b/index.html @@ -3,10 +3,12 @@ Dive Into Python 3 - + + -

skip to main content -

-

Porting code to Python 3 with 2to3

+

Life is pleasant. Death is peaceful. It’s the transition that’s troublesome.
— Isaac Asimov (attributed)

diff --git a/your-first-python-program.html b/your-first-python-program.html index ca7e470..7c160f0 100644 --- a/your-first-python-program.html +++ b/your-first-python-program.html @@ -3,17 +3,17 @@ Your first Python program - Dive into Python 3 - + + + -

skip to main content -

-

Your first Python program

+

Don’t bury your burden in saintly silence. You have a problem? Great. Rejoice, dive in, and investigate.
Ven. Henepola Gunararatana

@@ -239,7 +239,7 @@ if __name__ == "__main__": >>> humansize.__name__ 'humansize'

But you can also run the module directly as a standalone program, in which case __name__ will be a special default value, __main__. Python will evaluate this if statement, find a true expression, and execute the if code block. In this case, to print two values. -

c:\home\diveintopython3> c:\python30\python.exe humansize.py
+
c:\home\diveintopython3> c:\python30\python.exe humansize.py
 1.0 TB
 931.3 GiB

© 2001-4, 2009 ark Pilgrim, CC-BY-3.0