2008-06-01ãã1ã¶æéã®è¨äºä¸è¦§
Macã§ã®Pythonéçºç°å¢ã¨ãã¦IDLEãmiã§ããã°ã£ããã©ããããéçãªã®ã§IDEç°å¢ã®å°å ¥ãæ¤è¨ãã¾ããã 調æ»ããã¨ããã¡ã¸ã£ã¼åº¦(ã¦ã¼ã¶ãå¤ãæ¹ãæ å ±å¤ããâ¦)ãWindowsã«åæ§ã®ç°å¢ãä½ããããªã®ã§PyDevã«ãã¾ãããã¤ã³ã¹ãã¼ã«æ¹æ³ã®ã¨ã³ããªã¼ãæ¸â¦
ããã¹ããã¡ã¤ã«ãèªã¿è¾¼ãå ´åã«æ°ãã¤ããªãã¨ãããªãæ¹è¡ã«ã¤ãã¦ã®è§£èª¬ããã¾ããä»åèªã¿è¾¼ãããã¹ããã¡ã¤ã«ã®å 容ã¯ä»¥ä¸ã¨ãªãã¾ããtest.txt 111 222 333 444 ããã¹ããã¡ã¤ã«ãèªã¿è¾¼ãããã°ã©ã ã¯ä»¥ä¸ã¨ãªãã¾ãã f = open('test.txt', 'r')â¦
islower() 㨠isupper() ã®é¢æ°ã§ãããªãã¡ã¬ã³ã¹ããã£ã¨ç¢ºèªããããä»ã®è¨èªã®çµé¨ã®ããæ¹ã¯è±æåã®å°æåã大æåãå¤å®ããé¢æ°ã ã¨èªèããã人ãå¤ãã®ã§ã¯ãªããã¨æãã¾ã(èªåãããã§ãã)ããããã注æãã¦ãã ãããã»ã¼ãã®èªèã§å¤§ä¸å¤«ãªâ¦
anchorãè¨å®ãããã¨ã§ã¦ã£ã³ãã¦ã®ã©ã®ä½ç½®ã«é ç½®ãããã®æå®ãã§ãã¾ãããã®ããã«ä½¿ãã¾ãã # -*- coding: utf-8 -*- from Tkinter import * root = Tk() root.geometry("300x300") root.title(u"ã¿ã¤ãã«") button = Button(root, text="CENTER") buâ¦
ã¨ããããããã ãã®è¨è¿°ã§ã¦ã£ã³ãã¦ã表示ã§ãã¾ãã # -*- coding: utf-8 -*- from Tkinter import * root = Tk() root.mainloop() ã¦ã£ã³ãã¦ã®ã¿ã¤ãã«ã¯ title() ã¡ã½ããã§è¨å®ãã¾ãã # -*- coding: utf-8 -*- from Tkinter import * root = Tk() â¦
padx, padyã¯ã¹ã¬ã¤ãã¦ã£ã¸ã§ãã(ãã¿ã³ããªã¹ãããã¯ã¹ãªã©ã®ãã¼ã)ã®å¤å´ã«ç¢ºä¿ãããããã£ã³ã°(padding=è©°ãç©)å¹ ãæå®ãã¾ãã # -*- coding: utf-8 -*- from Tkinter import * root = Tk() root.geometry("100x100") root.title(u"ã¿ã¤ãã«") butâ¦
ipadx, ipadyã¯ã¹ã¬ã¤ãã¦ã£ã¸ã§ãã(ãã¿ã³ããªã¹ãããã¯ã¹ãªã©ã®ãã¼ã)ã®å å´ã«ç¢ºä¿ãããããã£ã³ã°(padding=è©°ãç©)å¹ ãæå®ãã¾ããipadx ã§Xæ¹å(å·¦å³)ã«ããã£ã³ã°ãè¡ãã¾ãã # -*- coding: utf-8 -*- from Tkinter import * root = Tk() root.geâ¦
fill ã¯æå®ã®æ¹åã®éçã¾ã§å¼ã伸ã°ã(fill=æºããã)ã¾ãããã¨ãã°ãã®ããã« X ãæå®ããã¨Xæ¹åã¸å¼ã伸ã°ããã¾ãã # -*- coding: utf-8 -*- from Tkinter import * root = Tk() root.geometry("100x100") root.title(u"ã¿ã¤ãã«") button = Buttonâ¦
Windowsã«pygameãã¤ã³ã¹ãã¼ã«ããæé ã説æãã¾ãã ãã¡ããå ã«Pythonãã¤ã³ã¹ãã¼ã«ãã¦ããå¿ è¦ãããã¾ãã®ã§ãã¡ãã¯äºåã«ã¤ã³ã¹ãã¼ã«ãã¦ããã¦ä¸ããã1. 以ä¸ã®URLãéãã pygame - python game development http://www.pygame.org/download.â¦
æå®ã®ãã¡ã¤ã«ãå®è¡ãããµã³ãã«ã§ãã Windowsåæã§æ¸ãã¦ãã¾ããå®è¡ãã¦ãããã¡ã¤ã«ãªã©ãå¤æ´ããã°ãã®ä»ã®ç°å¢ã§ãåæ§ãªãã®ãä½æã§ãã¾ããããã°ã©ã ã®å®è¡ã¯ä»¥ä¸ã®æ§ã«ã³ãã³ãã©ã¤ã³ããå®è¡ãããã¨ãåæã¨ãã¦ãã¾ãã python test.py â¦
æ¯åã注æç¹ãæ¸ãã®ãå¹çãæªãã®ã§ããã«æ³¨æç¹ãã¾ã¨ãã¦ããã¾ãã Pythonã®ãã¼ã¸ã§ã³ã®ç¢ºèª ã¾ãã¯Pythonã®ãã¼ã¸ã§ã³ãææ¡ãã¦ãããã¨ãéè¦ã§ãããã¼ã¸ã§ã³ç¢ºèªã®ç°¡åãªæ¹æ³ã¨ãã¦ã¯ã³ãã³ãã©ã¤ã³ã§ python ã¨ã¿ã¤ãããPythonãèµ·åããæ¹æ³â¦
twitterçºãã¦ããnitoyonããã 13æ¥ã®éææ¥ã« json ãã¡ã¤ã«ãããããã¨ãæ¸ããæ°ããã http://twitter.com/nitoyon/statuses/833714466 ã¨å¤©æçã³ã¡ã³ããæ¸ãã¦ããã®ã§åå¿ãã¦ãJSONã¯ããã¦ã¿ãããããã«JSONãã§ãã¦ããçµæ§ãã£ã¦ããã®ã§ã©â¦
sample.py import sys print sys.argv for arg in sys.argv: print arg ã³ãã³ãã©ã¤ã³ãããã®ããã«å®è¡ãã㨠python sample.py a b cãã®ããã«ãªãã ['sample.py', 'a', 'b', 'c'] sample.py a b c
次㫠unpack() é¢æ°ã®è§£èª¬ããã¾ããä»åã¯ãã¤ããªã¨ãã£ã¿ã§è¦ãã¨ãã«ä»¥ä¸ã®ãããªãã¼ã¿ã¨ãªã£ã¦ãããã¡ã¤ã«(test.dat)ã®å 容ãåãè¾¼ããµã³ãã«ãè¨è¿°ãã¾ãã 01 02 03 04ãã¡ãã®ãã¡ã¤ã«ãã1ãã¤ãèªã¿è¾¼ãå ´åã¯ãã®ããã«æ¸ãã¾ãã from structâ¦
ãã¾ã©ããã¤ããªãã¼ã¿ãå å·¥ãããããªäººã¯ç»åå¦çãå§ç¸®ãæå·ãªã©ãæ±ã£ã¦ãæ§ãªäººããå± ãªãããç¥ãã¾ãããã¡ãã£ã¨å¿ è¦ãæã£ã¦èª¿ã¹ãã®ã§æ¸ãã¨ãã¾ããPythonã§ãã¤ããªãã¼ã¿ãå å·¥ããã¨ã㯠pack() ã unpack() é¢æ°ã使ç¨ãã¾ãã å ¬å¼ã®ããâ¦
ãã®åå ¬éãããï¼³WFã®ãã©ã¼ãããä»æ§æ¸ãå ã«ä½ã¨ãæå®ã®æåå(ããã¤ã¹ãã©ã³ã)ãåãè¾¼ãã SWFãã¡ã¤ã«ãä½æããããã°ã©ã ãå®æãã¾ããã©ãã¨ãããã¨ã¯ãªãããã°ã©ã ã§ããåãã¦ã®SWFçæãªã®ã§ãHello Worldãã¬ãã«ããã£ã¦ãã¨ã§â¦ãããâ¦
ä»åº¦ã¯hetemlã§Pythonã使ããã¨ãã¦ä»åãã¾ãã¾ãã¯ã¾ã£ãã®ã§ã¡ã¢ãhetemlã®ãµã¼ãããããè¦ãã¨ç¢ºãã«ä½¿ããã¯ãã ãã©åä½ããã http://heteml.jp/service/function/PerlãRubyã®æ å ±ã¯ããã«ãããã©Pythonã«ã¤ãã¦ã¯ç¡ãã http://heteml.jp/supporâ¦
ãããã¤ã³ã¿ã¼ãããã®ãµã¼ãã§ã¯ã¯ã©ã¹å®ç¾©ã§ãããªæãã§ç¶æ¿ããªãã®ã« () ãä»ããã¨ã¨ã©ã¼æ±ãã¨ãªãã¿ããã class Test(): ã¡ããã¨ãã®ããã«æ¸ãã°å¤§ä¸å¤«ã§ããã class Test:
ãããã¤ã³ã¿ã¼ãããä¸ãå¥ãã¡ã¤ã«ã®ã¤ã³ãã¼ããããã¨ãã«ã¯ã¾ã£ãã®ã§ã¡ã¢ãåå ã調æ»ããããããã°ã©ã ãã§ããã ãåç´åãã¦ä»¥ä¸ã®ããã«ãã¦ãã¨ã©ã¼ãçºçãããtest.cgi #!/usr/local/bin/python # -*- coding: utf-8 -*- import cgi import cgâ¦
ãããã¤ã³ã¿ã¼ãããã§Pythonã使ãã¨ãã«ã¡ãã£ã¨ã¯ã¾ã£ãã®ã§ä½¿ãæ¹ãã¾ã¨ãã¦ãããã¨ããããèªåã¯ãã¹ã¿ã³ãã¼ããã§å¥ç´ãã¦ããã®ã§ãã¹ã¿ã³ãã¼ããã§ã®åä½èª¬æã¨ãªãã¾ããè¨ç½®æ¹æ³ã®èª¬æã¯å ¬å¼ã®ãµãã¼ãæ å ±ããã¡ãã«ããã¾ãã http://suppoâ¦