Title of English-language original: Python for Kids A Playful Introduction to Programming ISBN 978-1-59327-407-8, published by No Starch Press, Inc. Copyright 2013 by Jason R. Briggs. Japanese-language edition copyright 2014 by Ohmsha, Ltd. All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording or by any information storage retrieval system, without permission from No Starch Press, Inc. Python E-mail shoseki@ohmsha.co.jp
Web PC Python Python iii
iv Python Python Python Python http://www.ohmsha.co.jp/data/link/978-4-274-06944-4/ Python for Kids 10 11 14 15 18 Python Python 2014 2
v Python Scheme Haskell TeX
Python Python 1 Python Python 1960 Logo Python turtle tkinter Tk GUI 1 vii
viii 1. 2. Python Python 1 Python if for Python tkinter Python IDLE 2 IDLE 2 Integrated DeveLopment Environment
ix IDLE IDLE IDLE 1 Python 2 3 Python 4 turtle 5 if 6 for while 7 8 9 Python 10 Python 11 turtle 12 tkinter 13 14 Bounce! 15 18 PyGame Python
x No Starch Bill Pollock Bill Serena Yang 300 Miran Lipovača Josh Maria 1970
xi iii vii I 1 1 3 1.1... 4 1.2 Python... 4 1.3 Python... 10 1.4... 11 1.5... 13 2 15 2.1 Python... 15 2.2... 18 2.3... 20 2.4... 22
xii 3 23 3.1... 23 3.2... 29 3.3... 34 3.4 Python... 34 3.5... 36 3.6... 37 4 39 4.1 Python turtle... 39 4.2... 46 4.3... 46 5 if else 47 5.1 if... 47 5.2 if else... 51 5.3 if elif... 52 5.4... 53 5.5 None... 53 5.6... 54 5.7... 56 5.8... 56 6 59 6.1 for... 59
6.2... 65 6.3... 67 6.4... 67 xiii 7 69 7.1... 70 7.2... 73 7.3... 75 7.4... 76 8 77 8.1... 78 8.2... 86 8.3... 88 8.4... 89 8.5... 90 9 Python 91 9.1... 91 9.2... 101 9.3... 105 9.4... 106 10 107 10.1 copy... 108
xiv 10.2 keyword... 110 10.3 random... 111 10.4 sys Python... 113 10.5 time... 115 10.6 pickle... 118 10.7... 119 10.8... 120 11 121 11.1... 121 11.2... 122 11.3... 125 11.4... 127 11.5... 129 11.6... 130 11.7... 132 11.8... 133 11.9... 134 12 tkinter 135 12.1... 136 12.2... 138 12.3... 139 12.4... 139 12.5... 140 12.6... 147
12.7... 148 12.8... 150 12.9... 151 12.10... 152 12.11... 154 12.12... 156 12.13... 157 12.14... 158 xv II Bounce! 159 13 Bounce! 161 13.1... 161 13.2... 162 13.3... 163 13.4... 165 13.5... 169 14 Bounce! 171 14.1... 171 14.2... 176 14.3... 179 14.4... 179
xvi III 181 15 183 15.1... 184 15.2 GIMP... 184 15.3... 186 15.4... 191 16 193 16.1 Game... 193 16.2... 197 16.3... 197 16.4... 202 16.5... 203 16.6... 205 16.7... 206 17 207 17.1... 207 17.2... 210 17.3... 211 17.4... 211 17.5... 212
18 213 18.1... 213 18.2... 224 18.3... 225 18.4... 227 18.5... 232 18.6... 232 xvii 233 Python 239 249 253
I
1 1 DVD 1 3
4 1 1.1 Pascal Ada BASIC FORTRAN TV Python Python python NOTE 1970 Python Python Python { } # $ Python 1.2 Python Python Windows 7 Mac OS X Ubuntu Python IDLE Integrated DeveLopment Environment Python Python 10 Python
Windows 7/8 Python 1.2 Python 5 Microsoft Windows 7 8 Python http://www. python.org Python 3 Windows Downloads Download for Windows. I NOTE Python 3 Python Windows 1. Install for All Users Next 2. C:Y=Python32 C:Y=Python33 Next 3. Next
6 1 Python 3. Python 3 1. 2. Y=Python32 c:y=python33y=liby=idleliby=idle.pyw -n
1.2 Python 7 3. 4. IDLE 10 Python Python Mac OS X Python Mac Python http://www.python.org/getit/ Mac Mac Mac OS X OS Mac Mac OS X 10.5 32-bit i386/ppc Python 3 10.6 64-bit 32-bit x86-64 Python 3.dmg. I Python.mpkg Python IDLE 1. Spotlight 2. Automator
第1章 8 蛇 絵 3. 表示 4. Automator 起動 次 進 一覧 5. 選択 6. 中 実行 以下 cat 7. 部分 選択 探 空 書 以下 変更 open -a "/Applications/Python 3.2/IDLE.app" --args -n Python 3.2 部分 合 Python 変更 8. 保存 選択 IDLE 入力 名前
1.2 Python 9 9. 10 Python Python Ubuntu Python Ubuntu Linux Python Python 3 Ubuntu 12.x 1. Ubuntu Software Center Software 2. Software Center Python 3. IDLE IDLE (using Python-3.2). I 4. Install 5. Authenticate NOTE Ubuntu Python(v3.2) OK
10 1 Python 1.3 Python Windows Mac OS X IDLE Ubuntu Applications Programming IDLE (using Python 3.2) Python IDLE >>> >>> print("hello World") "..Enter >>> print("hello World") Hello World >>>
1.4 11 Python Python print Python Hello World 1.4 Python 10 IDLE File New File *Untitled* Python Python. I print("hello World")
12 1 File Save hello.py Run Run Module Python hello.py Run Run Module Python Python Run Python Shell hello.py Windows Python Hello World