ãã®æ¬ã¯ãåå¿è ããã°ã©ããŒãšãPythonãåŠãŒããšããŠããããã§ã«ä»ã®èšèªã§ããã°ã©ãã³ã°ã®çµéšããã人ã®äž¡æ¹ã«çæ³çã§ãã ææ°ã®Pythonããã±ãŒãžãšã©ã€ãã©ãªã®è©³çŽ°ã瀺ããŸãã
æäœçã«ã¯ããã®åºçç©ã¯ã³ãŒããæ£ãã°ããããããã¥ã¢ã«ã«äŒŒãŠãããPython 3ã®ããŸããŸãªæŠå¿µã詳现ã«èª¬æããŠããŸãã
ãã®æ¬ãèªãã åŸã¯ãPythonãããããããšã確èªããã ãã§ãªãããã¹ãããããã°ãã³ãŒãã®åå©çšã®æè¡ãç¿åŸããããŸããŸãªåéã§Pythonã䜿çšããæ¹æ³ãåŠã³ãŸãã
ã¯ããã«
ãã®æ¬ã¯ãPythonããã°ã©ãã³ã°èšèªã玹ä»ããŸãã åå¿è ããã°ã©ããŒã察象ãšããŠããŸããããã§ã«ããã°ã©ã ãäœæããŠããŠãå©çšå¯èœãªèšèªã®ãªã¹ãã«Pythonãè¿œå ãããå Žåã§ããSimple Pythonãšããåºçç©ããããŸãã ããã°ã©ãã³ã°ã®ã¢ãã³ãªã¹ã¿ã€ã«ããããã«åœ¹ç«ã¡ãŸãã
ãã®æ¬ã¯ãåºæ¬ããããå€ãã®è©³çŽ°ãªãããã¯ã«åŸã ã«ããªããå°ããã£ãããšãã玹ä»ã§ãã æç§æžãšæçæ¬ã®ã¹ã¿ã€ã«ãçµã¿åãããŠãæ°ããçšèªãšã¢ã€ãã¢ã亀äºã«èª¬æããŸããã Pythonã³ãŒãã¯æåã®ç« ã«ãå«ãŸããŠããŸãã
ãã®æ¬ã¯èªè ã察象ã«ããŠããŸãããNoSQLããŒã¿ããŒã¹ãã¡ãã»ãŒãžããã·ã³ã°ã©ã€ãã©ãªãªã©ãè€éã«æãããããã¯ãå«ãŸããŠããŸãã ããããéžæããã®ã¯ãæšæºã®ææ³ãããå€ãã®åé¡ã解決ããã®ã«åœ¹ç«ã€ããã§ãã ãå èµããããªãŒããã¢ããªã±ãŒã·ã§ã³ã«é©ããªãå Žåã«äŸ¿å©ãªå€éšPythonããã±ãŒãžãããŠã³ããŒãããŠã€ã³ã¹ããŒã«ããŸãã æ°ããããšãè©Šãã®ã¯æ¥œããã§ãã
ãŸããç¹ã«ä»ã®ããã°ã©ãã³ã°èšèªãæ¢ã«äœ¿çšããŠããããã®ã¹ã¿ã€ã«ãPythonã«é©å¿ãããããšããŠããå Žåã¯ãç¹ã«å¿ èŠã®ãªãããšã®äŸãããã€ãæ¬ã«å«ããŸããã Pythonããã°ã©ãã³ã°èšèªãå®ç§ã ãšã¯èšããŸãããé¿ããã¹ãããšã瀺ããŸãã
ç°¡åãªèª¬æ
æåã®7ã€ã®ç« ã§ã¯ãPythonããã°ã©ãã³ã°èšèªã®åºæ¬ã«ã€ããŠèª¬æããé çªã«èªãå¿ èŠããããŸãã 次ã®ç« ã§ã¯ãã€ã³ã¿ãŒããããããŒã¿ããŒã¹ããããã¯ãŒã¯ãªã©ã®ç¹å®ã®é åã§Pythonããã°ã©ãã³ã°èšèªãã©ã®ããã«äœ¿çšãããã©ã®ãããªé åºã§èªãããã瀺ããŸãã æåã®3ã€ã®ã¢ããªã±ãŒã·ã§ã³ã¯ãèžè¡ãããžãã¹ãç§åŠã«ãããPythonããã°ã©ãã³ã°èšèªã®äœ¿çšã瀺ããŠããŸãã 次ã«ãPython 3ããªãå Žåã®ã€ã³ã¹ããŒã«æ¹æ³ãåŠã³ãŸãã ããã«ç¶ããŠãåç« ã®æåŸã«ããæŒç¿ãžã®åçãšãããã€ãã®åœ¹ç«ã€ãªã¹ããç¶ããŸãã
第1ç« ããã°ã©ã ã¯ãéŽäžãç·šããããžã£ã¬ã€ã¢ãæãããããªãã®ã§ãã Pythonã§æžãããå®éã®ããã°ã©ã ã䜿çšããŠãèšèªã®æ§æããã®æ©èœãããã³å®äžçã§ã®ã¢ããªã±ãŒã·ã§ã³ã®äœ¿çšæ¹æ³ã瀺ããŸãã æ¯èŒãããšãPythonã¯ä»ã®èšèªã«è² ããŸããããå®ç§ã§ã¯ãããŸããã å€ãããŒãžã§ã³ã®PythonïŒPython 2ïŒã¯ãæ°ããããŒãžã§ã³ïŒPython 3ïŒã«ç§»è¡ããŸãã Python 2ãã€ã³ã¹ããŒã«ãããŠããå Žåã¯ãã³ã³ãã¥ãŒã¿ãŒã«Python 3ãã€ã³ã¹ããŒã«ãã察話åã€ã³ã¿ãŒããªã¿ãŒã䜿çšããŠããã®æ¬ã®äŸãèªåã§å®è¡ããŸãã
第2ç« ãã®ç« ã§ã¯ãPythonããã°ã©ãã³ã°èšèªã§äœ¿çšãããæãåçŽãªããŒã¿åãããŒã«å€æ°ãæŽæ°ãæµ®åå°æ°ç¹æ°ãããã¹ãæååã瀺ããŸãã ãŸããåºæ¬çãªæ°åŠããã³ããã¹ãæäœãåŠã³ãŸãã
第3ç« ãªã¹ããã¿ãã«ããã£ã¯ã·ã§ããªãã»ããã®äžäœã¬ãã«ã®çµã¿èŸŒã¿ããŒã¿æ§é ãèŠãŠãããŸãã ãããã®ããŒã¿åãLegoã³ã³ã¹ãã©ã¯ã¿ãŒãšããŠäœ¿çšããŠãããè€éãªæ§é ãäœæããŸãã ã€ãã¬ãŒã¿ãšãªã¹ãã®ã€ã³ã¯ã«ãŒãã䜿çšããŠããããã調ã¹ãæ¹æ³ãåŠç¿ããŸãã
第4ç« ããã§ã¯ãæ¯èŒãéžæããŸãã¯ç¹°ãè¿ããå®è¡ããããã«ãåã®ç« ã®ããŒã¿æ§é ãšã³ãŒãæ§é ãç¹ã蟌ã¿ãŸãã ã³ãŒããé¢æ°ã«ããã¯ããäŸå€ã䌎ããšã©ãŒãåŠçããæ¹æ³ãåŠç¿ããŸãã
第5ç« ãã®ç« ã§ã¯ãã¢ãžã¥ãŒã«ãããã±ãŒãžãããã°ã©ã ãªã©ã®ãã倧ããªããŒã¿æ§é ã«ç§»è¡ããæ¹æ³ã瀺ããŸãã ã³ãŒããšããŒã¿ãé 眮ããå ŽæãããŒã¿ãå ¥åããã³åºåããå ŽæãããŸããŸãªãªãã·ã§ã³ãåŠçããå Žæãããã³æšæºã®Pythonã©ã€ãã©ãªã調ã¹ãå Žæã«ã€ããŠåŠç¿ããŸãã
第6ç« ä»ã®èšèªã§ãªããžã§ã¯ãæåããã°ã©ãã³ã°ã«ãã§ã«é¢äžããŠããå ŽåãPythonã¯ãããã«æ¯ã¹ãŠç°¡åã«èŠããŸãã 第6ç« ã§ã¯ããªããžã§ã¯ããšã¯ã©ã¹ã䜿çšããå Žåãšãã¢ãžã¥ãŒã«ããªã¹ãããŸãã¯èŸæžã䜿çšããå Žåã«ã€ããŠèª¬æããŸãã
第7ç« ããŒã¿ãå°éçã«ç®¡çããæ¹æ³ãåŠã³ãŸãã ãã®ç« ã¯ãããã¹ãããã³ãã€ããªããŒã¿ãUnicodeæåã®äœ¿çšæ¹æ³ãããã³I / Oã«å®å šã«å°å¿µããŠããŸãã
第8ç« ããŒã¿ã¯ã©ããã«é 眮ããå¿ èŠããããŸãã ãã®ç« ã§ã¯ãåçŽãªãã¡ã€ã«ããã£ã¬ã¯ããªãããã³ãã¡ã€ã«ã·ã¹ãã ã®æäœãéå§ããŸãã 次ã«ãCSVãJSONãXMLãªã©ã®åçŽãªãã¡ã€ã«åœ¢åŒãæ±ãæ¹æ³ãåŠã³ãŸãã ãŸãããªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ããã³ææ°ã®NoSQLããŒã¿ãŠã§ã¢ããŠã¹ããããŒã¿ãä¿åããã³ååŸããæ¹æ³ã«ã€ããŠãåŠç¿ããŸãã
第9ç« ã¯ã©ã€ã¢ã³ãããµãŒããŒãããŒã¿æœåºãAPIãããã³ãã¬ãŒã ã¯ãŒã¯ãã«ããŒããå¥ã®ç« ãWorld Wide Webã«åœãŠãããŠããŸãã 第9ç« ã§ã¯ãã¯ãšãªãã©ã¡ãŒã¿ãšãã³ãã¬ãŒãã䜿çšããŠå®éã®ãµã€ããéçºããŸãã
第10ç« ããã®ç« ã¯ãã·ã¹ãã ããã°ã©ãã³ã°ã«é¢ãããã®ã§ãã ããã§ã¯ãããã°ã©ã ãããã»ã¹ãã¹ã¬ããã®ç®¡çãæ¥ä»ãšæå»ã®æäœãã·ã¹ãã 管çã¿ã¹ã¯ã®äžéšã®èªååã®æ¹æ³ãåŠã³ãŸãã
第11ç« ãã®ç« ã®ãããã¯ã¯ãããã¯ãŒã¯ãã€ãŸããµãŒãã¹ããããã³ã«ãããã³APIã§ãã äŸã«ã¯ãäœã¬ãã«ã®ãœã±ãããã¡ãã»ãŒãžã³ã°ã©ã€ãã©ãªããã¥ãŒã€ã³ã°ã·ã¹ãã ãããã³ã¯ã©ãŠãå±éãå«ãŸããŸãã
第12ç« ãã®ç« ã«ã¯ãPythonããã°ã©ãã³ã°èšèªã§äœæããéçºè åãã®ãã³ããå«ãŸããŠããŸãã ãããã«ã¯ãã€ã³ã¹ããŒã«ãIDEã®äœ¿çšããã¹ãããããã°ããã°ããœãŒã¹ç®¡çãããã³ããã¥ã¡ã³ããå«ãŸããŸãã 第12ç« ã¯ãæçšãªãµãŒãããŒãã£ããã±ãŒãžã®æ€çŽ¢ãšã€ã³ã¹ããŒã«ãåå©çšã®ããã®ã³ãŒãã®ããã¯ãããã³è©³çŽ°æ å ±ã®å ¥æå ã®æ€çŽ¢ã«ã圹ç«ã¡ãŸãã
ä»é²A.æåã®ä»é²ã§ã¯ãã°ã©ãã£ãã¯ã¹ãé³æ¥œãã¢ãã¡ãŒã·ã§ã³ãã²ãŒã ãªã©ãPythonããã°ã©ãã³ã°èšèªã䜿çšããŠã¢ãŒãã§äººã ãè¡ãããšã«ã€ããŠèª¬æããŸãã
ä»é²B. Pythonããã°ã©ãã³ã°èšèªã®ããã€ãã®æ©èœãããžãã¹ã«é©çšã§ããŸãïŒããŒã¿ã®èŠèŠåïŒã°ã©ããã°ã©ãããããïŒãã»ãã¥ãªãã£ãããã³èŠå¶ã
ä»é²B. Pythonããã°ã©ãã³ã°èšèªã¯ãæ°åŠãšçµ±èšãç©çåŠãçç©åŠãå»åŠãªã©ã®ç§åŠæŽ»åã§åºã䜿çšãããŠããŸãã ã¢ããªã±ãŒã·ã§ã³ã¯ãNumPyãSciPyãããã³PandasããŒã«ã®æ©èœãå®èšŒããŸãã
ä»é²D. Python 3ãã³ã³ãã¥ãŒã¿ãŒã«ãŸã ã€ã³ã¹ããŒã«ããŠããªãå Žåããã®ã¢ããªã±ãŒã·ã§ã³ã§ã¯ãã€ã³ã¹ããŒã«ãããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ïŒWindowsãMac OS / XãLinuxããŸãã¯UnixïŒã«é¢ä¿ãªãããããè¡ãæ¹æ³ã«é¢ããæ å ±ããããŸãã
ä»é²D.åç« ã®æåŸã®æŒç¿ã«å¯Ÿããåçã以äžã«ç€ºããŸãã åé¡ãèªåã§è§£æ±ºããããšãããŸã§ããããèŠããªãã§ãã ããã
ä»é²E.ãã®ä»é²ã«ã¯åç §ããŒã¿ãå«ãŸããŠããŸãã
PythonããŒãžã§ã³
ããã°ã©ãã³ã°èšèªã¯æéãšãšãã«å€åããŸã-éçºè ã¯ãããã«æ°ããæ©èœãè¿œå ãããã°ãä¿®æ£ããŸãã ãã®æ¬ã®äŸã¯ãPythonããŒãžã§ã³3.3åãã«äœæããã³ãã¹ããããŠããŸãã ããŒãžã§ã³3.4ã¯ãã®æ¬ãšåæã«ãªãªãŒã¹ããããã®ã§ãããã€ãã®é©æ°çæè¡ã«ã€ããŠèª¬æããŸãã Pythonããã°ã©ãã³ã°èšèªã«äœããã€è¿œå ãããããç¥ãããå Žåã¯ã ããŒãžã«ã¢ã¯ã»ã¹ããŠãã ãã ã æè¡æ å ±ãããã«è¡šç€ºãããŸãã PythonãåŠç¿ãå§ããã°ããã®å Žåã¯ç解ãã«ããããã«æãããããããŸããããå°æ¥ãä»ã®ããŒãžã§ã³ã®Pythonãã€ã³ã¹ããŒã«ãããŠããã³ã³ãã¥ãŒã¿ãŒçšã®ããã°ã©ã ãäœæããå¿ èŠãããå Žåã«åœ¹ç«ã¡ãŸãã
èè ã«ã€ããŠ
Bill Lyubanovich㯠1977幎ããUnixãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã§ããã°ã©ãã³ã°ãè¡ã£ãŠããã1981幎ããGUIãéçºããããŒã¿ããŒã¹ã¯1990幎ããã1993幎ããWebéçºã«åŸäºããŠããŸãã
1982幎ã圌ã¯Intranã¹ã¿ãŒãã¢ããã®äœæ¥äžã«ãæåã®ã°ã©ãã£ã«ã«ã¯ãŒã¯ã¹ããŒã·ã§ã³ã®1ã€ã§äœ¿çšããããã®æåã®åæ¥çã«æåããGUIïŒMacãŸãã¯Windows以åïŒã®1ã€ã§ããMetaFormãäœæããŸããã 1990幎ã«ã圌ã¯Northwest Airlinesã®èŠèŠçãªåç管çã·ã¹ãã ãäœæããæ°çŸäžãã«ã®åçãçã¿åºããŸããã ããã«ãLyubanovichã¯ã€ã³ã¿ãŒãããäžã§äŒç€Ÿã®ãã·ã§ãŒã±ãŒã¹ããäœæããWebäžã®ããŒã±ãã£ã³ã°ãåæããããã®æåã®ãã¹ãã圌女ã«æžããŸããã ãã®åŸã1994幎ã«ã€ã³ã¿ãŒããããµãŒãã¹ãããã€ããŒã§ãããã©ãå ±åèšç«ãã1999幎ã«Mad Schemeã€ã³ã¿ãŒãããäŒç€Ÿã®èšç«ã«åå ããŸããã
ãã®åŸããã«ã»ã«ãããããã¯ããã³ããã¿ã³ã®æ°èäŒæ¥ã§åãããŒã ã®äžå¡ãšããŠãã«ãŒãã«ãµãŒãã¹ãšåæ£ã·ã¹ãã ãéçºããŸããã çŸåšããã®æ¬ã®èè ã¯ãã¹ãŒããŒã³ã³ãã¥ãŒã¿ãŒäŒç€Ÿã§ã®OpenStackãµãŒãã¹ã®çµ±åã«åãçµãã§ããŸãã
ãã«ã¯ãããœã¿å·ã§ã劻ã®ã¡ã¢ãªãŒãæ¯åã®ãã ãåšã®ã«ãªã³ãšäžç·ã«å¹žãã«æ®ãããç«ã®ã€ã³ã¬ãšã«ãŒã·ãŒãšç«ã®ãã§ã¹ã¿ãŒã®äžè©±ãããŸãã
ãã®æžç±ã®è©³çŽ°ã«ã€ããŠã¯ãåºç瀟ã®ãŠã§ããµã€ããã芧ãã ãã
ç®æ¬¡
æç²
Habrozhitelamiã®å Žåãã¯ãŒãã³ã®25ïŒ å²åŒ-Pythonã