Webéçºã«Pythonã使ãçç±
åã®å¨ãã ããããããªãã§ãããå½å
ã®Webåè¨éçºæ¡ä»¶ã¯ãPHPã§ä½ãã®ãæé»ã®ã«ã¼ã«ãã£ã¦ãªå¢ãã§PHPæ¡ä»¶ã°ã£ãããªã®ã§ãããPython大好ããªåã¨ãã¦ã¯ãä½ã¨ãã¦ã§ãPythonã使ã£ã¦ä»äºããããï¼
ãªã®ã§é å¼µã£ã¦å¸ææ´»åããã¦ããã®ã§ãããä¸ã
è¯ãæå¿ããå¾ãããªãã®ãç¾ç¶ã§ããã
ã¨ãã訳ã§ãæ¹ãã¦Pythonã使ãã¡ãªããã¨ããå®å¿ãã¦ã¯ã©ã¤ã¢ã³ãã«Pythonãé²ããããçç±ãªãããã¾ã¨ãã¦ã¿ã¾ããã
æè¡è ãPythonã使ãã¡ãªãã
ãä»ã¾ã§PHPã§ãã£ã¦ãã¦ä½ã®åé¡ããªãã£ãããããããPythonå§ããæå³ãªãã¦ããã®ï¼ã
ã¶ã£ã¡ããããããªã«ãªãã§ãï½
çµæçã«åºæ¥ä¸ããç©ã«é¢ãã¦ã¯å¤§å·®ãªãã§ããããã
ãã ããéçºå¹çãã¡ã³ããã³ã¹æ§ã¯é£èºçã«ä¸ããã¨åã¯æãã¾ãã
ã©ã¤ãã©ãªãã¨ã¦ãè±å¯
PHPã沢山ã©ã¤ãã©ãªããã¾ããã©ãPythonã ã£ã¦ãã£ã±ããããã§ããã
æ¨æºã©ã¤ãã©ãªãã¨ã¦ãå
å®ãã¦ããã¾ãã
ããã«easy_installã¨ãpipã使ãã°è¿½å ã¢ã¸ã¥ã¼ã«ã ã£ã¦ç°¡åã«å°å
¥åºæ¥ã¾ãã
PHPãPECLãããã¾ãããåæãã ãã§è¨ãã°Pythonã®æ¹ãå§åçã«å¤ãã§ãã
è¨èªä»æ§ã¨ç念ãç´ æ´ããã
Pythonã¯ä½ã¨è¨ã£ã¦ãã·ã³ãã«ã§ãã
PEP20ã¨ããPythonã®è¨è¨ç念çãªç©ãããã®ã§ãããèªãã§ã¿ãã¨ãæ¸ããããã»èªã¿ãããã»å¤ãããããã¨ããé¨åã«æ³¨åãã¦è¨è¨ããã¦ããäºãç解åºæ¥ãã¨æãã¾ãã
http://www.lifewithpython.com/2013/01/pep-20-the-zen-of-python.html
PEP20ã§å®ç¾©ããã¦ããäºæã¨ããã®ã¯ï¼å
¨ã¦ã§ã¯ãªãããã©ï¼ããã°ã©ã ãçµãä¸ã§ã©ã®è¨èªã使ç¨ããã¨ãã¦ã注æããã¹ãäºã°ããã§ãã
ããã¯åå人ã®å°è±¡ã§ãããPythonã¨ããè¨èªã使ãã¨ããã¾ãæèãããã¨ãPEP20ã®ç念ã®æ¹åã¸å®è£
ã®å½¢ãé²ãã§ããæ§ãªæ°ããã¾ãã
éçºå¹ç&ã¡ã³ããã³ã¹æ§ãé«ã
ã·ã³ãã«ã§å¤ããããã¨ããäºã¯ãå¹çã«ç´çµãã¾ãã
極端ã«è¨ãã¨Pythonã¯ä½ãããã®è¨èªãç¿å¾ãã¦ãã人ãªãã°ãèªã¿è§£ãäºã¯ããç¨é£ããã¯ããã¾ããã
ããã«ãPythonã¯èª°ãæ¸ãã¦ãããç¨åº¦ä¼¼éã£ãå®è£
ã«ãªãå¾åãããã¾ãã
ããã¯ã¤ã¾ãã誰ãè¦ã¦ãå¤ããããããã°ã©ã ã«ãªãã¨ããäºã ã¨æãã¾ãã
ã¾ããã½ã¼ã¹ã³ã¼ãã®éãç®ã«è¦ãã¦æ¸ãã¾ãã
ä½æã§ã¯PHPã®2/3ãããã«æãã¾ããã
ä¸æããã¨ååãããã«ãªã£ããããã¾ãã
ãã£ã±ãã³ã¼ãéãå°ãªãã¨ããã®ã¯éçºã®å¹çãããã§ãããã¡ã³ããã³ã¹æ§ãé«ãã§ãã
è¤æ°äººã§ã®éçºãå¼ãç¶ãæ¡ä»¶çãèããã¨ãã¡ã³ããã³ã¹æ§ãé«ãã¨ããã®ã¯ã¨ã¦ã大ããªã¢ããã³ãã¼ã¸ã«ãªãã¨æãã¾ãã
å¿è«ããã±ã¼ãã¨æ¸ãã¦ããæ±ããªãã®ã§ãã¡ããã¨ç¶ºéºã«æ¸ãåªåãããªãã¨ãã¡ã§ããã©ãã
Pythonã¯ããããåªåãå ±ããæãã¨ããäºã§ãã
å¼·åãªãã¬ã¼ã ã¯ã¼ã¯ããã
PHPã«ãCodeIgniterãSymfonyã®æ§ãªç´ æµãªãã¬ã¼ã ã¯ã¼ã¯ãå¤ã ããã¾ãããä¸é·ä¸çã¨ããããã¶ã£ã¡ããã©ã®ãã¬ã¼ã ã¯ã¼ã¯ä½¿ã£ã¦ãã¹ãã¬ã¹ãæºã¾ã£ã¦ãã¾ãã¾ãï¼åã¯ï¼ãã
Pythonã«ã¯Djangoã¨ããç´ æ´ããããã«ã¹ã¿ãã¯ã®ãã¬ã¼ã ã¯ã¼ã¯ãåå¨ãã¾ãã
ãã«ã¹ã¿ãã¯ã¯éããã¦å«ã ã¨ããã®ã§ããã°FlaskãPyramidãããã¾ãã
Tornadoã¨ãããã¬ã¼ã ã¯ã¼ã¯ã使ãã¨node.jsã®æ§ãªWebSocketãµã¼ãã¼ãç°¡åã«ä½ãã¾ãã
Pythonã®ãã¬ã¼ã ã¯ã¼ã¯ã«ã¯ãã£ããã¨åæ§ããããå®æ度ãç´ æ´ãããã§ãã
ã¹ãã¬ã¹ã®ç¡ããã¬ã¼ã ã¯ã¼ã¯ã使ããã¨ããã ãã§ããWebéçºã§Pythonãé¸ã¶ã¡ãªãããããã¨åã¯æãã¾ãã
ã¯ã©ã¤ã¢ã³ãã«Pythonãé¸ãã§è²°ãããã«
è²ã
ãã¼ã ãã¼ã è¨ãã¾ãããã©ããçµå±ã¯ã©ã¤ã¢ã³ãã«ãPythonã§ãã£ã¦ããããã£ã¦è¨ã£ã¦è²°ããªãã¨ã©ããããããªãã®ã§ã説å¾ããææãéãã¦ã¿ã¾ããã
çµå±ã¯ãPythonãªãã¦è¯ãåãããç©ããç使ã£ã¦ãPHPããããã¨ããäºãªãã§ããã©ãããã辺ãç´è§£ãã¦è¡ããããªããã¨ã
ãããªãã¤ãã¼è¨èªä½¿ãã人å°ãªãããããªãã®ï¼
å½å
å¤ã§å§åçãªã·ã§ã¢ãæã¤PHPã«æ¯ã¹ãã°ãPythonã®æè¡è
ã¯å°ãªãã§ãã
PHPã ã¨æ
å½ã®æè¡è
ãä½ããã®çç±ã§ãã¡ã«ãªã£ãå ´åã§ãã交代è¦å¡ãç°¡åã«è¦ã¤ããããã¨ããå¼·ã¿ãããã®ã¯ç¢ºãã§ãã
ããããã¾ã¨ãã«PHPæ¸ãã人ã¯Pythonãªããããã«æ¸ããããã«ãªããã§ãã
æè¡è
ãæ¢ãã®ã¯ãå®ã¯ããã»ã©é£ããäºãããªããã§ãã
ã¡ãªã¿ã«ãåç¥ã ã¨æãã¾ãããPythonã¯å½å
ã§ã¯ãã¤ãã¼ã£ã¦ã ãã§ãæµ·å¤ã§ã¯ç©åãã¡ã¸ã£ã¼ãªè¨èªã§ãã
æè¿ã®Linuxã«ã¯å¿
ãã¤ã³ã¹ãã¼ã«ããã¦ã¾ãããGoogleã®å
¬ç¨è¨èªã®1ã¤ã ã£ãããã¾ããã
å¾è¿°ãã¾ãããæ®æ®µä½¿ã£ã¦ããµã¼ãã¹ãPythonã§ä½ããã¦ããã®ã¯å¤ãã§ãã
ä½ãããã¡ããã¨åãã®ï¼
ä¾é ¼ããå´ã¨ãã¦ã¯ãåä½å®ç¸¾ãããã¨ããã¡ããã¨åãã¾ããã£ã¦ããä¿è¨¼ã欲ãããã§ãã
PHPã¯ãã®ç¹ãç©åãéã®Webãµã¼ãã¹ãPHPã§å®è£
ããã¦ããã®ã§ãå®å¿ã§ããã®ã§ããããã
ã§ãæ¬å½ã®äºè¨ãã¨ãã¾ã¨ãã«åãã¦ãªãã·ã¹ãã ã£ã¦PHPã§ä½ããããã®å¤ãã£ãããã
Pythonã§ä½ããã¦ã主ãªãµã¼ãã¹ããªã¹ãã¢ãããã¦ã¿ã¾ããã
ä»ã«ã½ã¼ã·ã£ã«ã²ã¼ã æ¥çã ã¨æ ªå¼ä¼ç¤¾gumiã¨ããä¼ç¤¾ãDjangoã使ã£ã¦ã²ã¼ã ãéçºãã¦ãã¾ãã
ã½ã¼ã·ã£ã«ã²ã¼ã ã¯æ¯ç§æ°ç¾ãªã¯ã¨ã¹ããå¦çããå¿
è¦ãããã®ã§ãWebãµã¼ãã¹ã¨ãã¦ã¯é«è² è·ãªé¨é¡ã«ãªãã¾ãããä½ãåé¡ãªãåãã¦ãã¾ãã
èªç¤¾ã§ã¡ã³ããã³ã¹ããããPHPã§ãé¡ã
PHPã®æè¡è
ãæ±ãã¦ãã¯ã©ã¤ã¢ã³ãããããã®æ¡ä»¶ã¯ãéçºçµäºå¾ã«ã¯ã©ã¤ã¢ã³ãããã®æ¹ã§éç¨ä¿å®ããããã¨ãæ®ã©ãªã®ã§ããã£ã±ãæ
£ããè¨èªã§æ¸ãããç©ã®æ¹ãã¡ã³ããã³ã¹æ§ãé«ãã®ã¯å½ç¶ã§ãããã
ã§ããä¸ã§ãç³ãã¾ãããã©ãããã¾ã¨ãã«PHPæ¸ãã人ã¯Pythonãæ¸ãã¾ããã
ããã¦ãã¡ã³ããã³ã¹ãéçºã®å¹çãéè¦ãããªãã°ãæ¯éã¨ãPythonãæ¡ç¨ãã¦é ãããï¼
ããã確ãã«ãåãã¦ã®Pythonæ¡ä»¶ã¯å¦ç¿ã®ã³ã¹ããæããã®ã§å¹çãæªãããããã¾ããããæªæ¥ã¸ã®æè³ã ã¨æã£ã¦é å¼µãã¨å¿
ãè¦è¿ããå¾ããã¾ãã
ã§ããããã°ã£ããã¯ãã®ä¼ç¤¾ã®æ¹éãªã®ã§ãå¤æ³¨ã®æã
ãã¨ãããè¨ãæã§ã¯ãªãã®ã§ããã©ããã
ã¾ã¨ã
ããããé¢åããããªã£ã¦ããã®ã§ã¾ã¨ãã¾ããã
ä½ãè¨ãããã®ãã£ã¦è¨ãã¨ã ãª
ããããªæªãããããããªãã便å©ã ããå®å¿ãã¦ãã£ã¦ãè¯ããã1å使ããããï¼ããããå¤ããï¼ã
ã£ã¦äºã§ããã
Pythonã«éã£ã話ãããªãã§ããã©ãRubyãªãScalaãªãHaskellãªã便å©ãªç©ã沢山ãããã ããããã¯ãã¯ãã¦ãªãã§é©æé©æã«ä¾¿å©ãªç©ã使ã£ã¦ããã£ã¨æ¥½ãã¦çãã¦ããããã£ã¦äºãè¨ããã訳ã§ããã