2009-01-01ãã1ã¶æéã®è¨äºä¸è¦§
ãªããè²ã æ¹æ³ã¯ããã®ã§ãããæºåãããã©ãããã£ãã®ã§ MozRepl 使ã£ã¦èªåã§ããã£ã¨ #!/usr/bin/env python # -*- coding: utf-8 -*- import sys,os,telnetlib,time class MozRepl: def __init__(self, host='localhost',port=4242): self.tn = telneâ¦
Re: http://subtech.g.hatena.ne.jp/cho45/20090115/1232016840 import sys a = ['a','b','c',] for i in range(len(a)): (lambda item,index : sys.stdout.write(str([item,index]) + '\n') )(a[i],i) å¼ããæ¸ããªããã©ï½
ãããªèªèã§ãã£ã¦ãã®ããªãï¼ã¨æã£ã¦ãã©ãã©æ¸ãã¦ã¿ã é¢æ°ã¯ã¹ã³ã¼ãæã£ã¦ãã®ã§ãã®ã¾ã¾ä»£å ¥ãã¦ã global ã®å¤ã¯å¤æ´ãããªãã In [1]: foo = 0 In [2]: def bar(): ...: foo = 1 ...: In [3]: print foo 0 In [4]: bar() In [5]: print foo 0 (â¦