try: hogehoge() except: print sys.exc_info()[0] ã£ã¦æ¸ããã¨ãã¦ããid:nishiohirokazu å çã« exceptionType, exceptionValue, exceptionTraceback = sys.exc_info() ã£ã¦ããã¨ããã [0]ã¯1å¹´å¾ã«å°ãç¾½ç®ã«ãªããã ã¨æãã¦ããã ããï¼ï¼ï¼ 1å¹´å¾â¦
ãã¤ã®ã¾ã«ãã Twitter ã« Follow å¶éã¨ãåºæ¥ã¦ è²ã ãªäººã®çºè¨ãè¦ããã®ã« Follow 追å åºæ¥ãªããªã£ã¦ ã³ã³ãã¥ã¼ã¿ã®çã«äººéæ§ã®å¦çè½åã«å¶éãããããããã¼ã㨠ãæãã®ã¿ãªãã¾ããã«ã¡ã¯ ãªã¼ãã³ã½ã¼ã¹ã¨ãã¶ã¼ã«ã¢ãã«ã®å¾¡ç¥ã«åå åºæ¥ãªãâ¦
- 解決 ï¼mechanize.Browser ã object ãç¶æ¿ããªãå¤ãã¿ã¤ãã®ã¯ã©ã¹ã ã£ãã¿ãã - ãã㯠OK >>> class Foo(object): def __init__(self,text): super(Foo,self).__init__(self) ... >>> foo = Foo('test') ã§ãmechanize.Browser ç¶æ¿ãã¦è¦ªã®ã³ã³ã¹ãâ¦
åãè¯ãããã£ã¦ãªãã®ã§ããã大å¤ã§ãï¼ï¼ ç¾äººæè¨ã®ç»åãèªåã®ãµã¼ãã«ä¿åãã¦å ¬éãã¦ã人ããã¾ãï¼ï¼http://image.baidu.jp/i?tn=baiduimage&ct=201326592&cl=2&word=site%3Abijint.com&lm=-1&z=0ããã£ã¦ãã£ããä¸å³ãã§ãããï¼ï¼ è¯ããããâ¦
http://d.hatena.ne.jp/Yamashiro0217/20090310/1236674979 ã®ã¯ã¦ã¶ã®ã¿ã°ã«ä½æ ã Python ã¿ã°ããã£ãã®ã§ã ãã㯠Python ã§æ¸ãã£ã¦äºããªãã¨æã£ã¦æ¸ãã¦ã¿ã¾ããã import sys,os,urllib,time;[[[globals().__setitem__('url','http://www.bijint.câ¦
http://d.hatena.ne.jp/a2c/20090301/1235909666 ãèªãã§â¦â¦ >>> def func(userid,password): ... print userid , password ... >>> hoge= {'userid':'foo','password':'bar'} >>> func(**hoge) foo bar >>> def func2(foo,bar): ... print foo , bar ... >>â¦
id:tfunato ã« ãããï¼Python ã§ãåºæ¥ãã!!ã ã¨ï¼è¨ã£ãæåï¼ã³ã¼ããæãã¦ã¿ã #!/usr/bin/env python # -*- coding: utf-8 -*- from hatenagraph import HatenaGraph from pit import Pit import urllib2 hatena_conf = Pit.get('hatena.ne.jp',{'reâ¦
ãã¦ã§ã¤ã³ã°ãª Pythonista ã¯ãã¹ã㯠nose ã使ãã¿ãããªã®ã§ãã è¯ããããã¾ããããããããã®ã§ãã äºåå¦çã¨äºå¾å¦ç DB ã®åæåã¨ããã¹ãã®äºåå¦çãäºå¾å¦çã¯ãªãã¨å°ã£ã¡ããã¾ããã nose ã§ã¯ãããªé¢¨ã«æ¸ãã¾ãã def setup_func(): # â¦
Python ã® atompub ã§ä½¿ããããã©ã¤ãã©ãªãã¿ã¤ãããªãã£ãã®ã§ èªåã§ã´ãªã´ãª #!/usr/bin/env python # -*- coding: utf-8 -*- # http://d.hatena.ne.jp/keyword/%a4%cf%a4%c6%a4%ca%a5%c0%a5%a4%a5%a2%a5%ea%a1%bcAtomPub import base64 import randomâ¦
http://d.hatena.ne.jp/mopemope/20090220/p4 ã§ãpip ã£ã¦ä½ï¼ï¼ pip http://pip.openplans.org/ pip is a replacement for easy_install. It uses mostly the same techniques for finding packages, so packages that were made easy_installable should â¦
ãªããæ¯åæ¸ãã®ã¡ã³ãã¤ã®ã§ snippet æ¸ããã 便å©âª # -*- coding: utf-8 -*- # name: pit # contributor: Yoshiori SHOJI <[email protected]> # -- ${1:name} = Pit.get('${2:domain}',{'require' : {'${3:require1}':'Your $2 $3}','${4:require2}':'Your $2 $4'}})</[email protected]>
ãªããè²ã ãªæ´å²ççµç·¯ããã£ã¦ emacs ã«ã¯ 2 ã¤ã® Python-mode ãããã£ã½ã emacs22 ã«æ¨æºã§ä»ãã¦ã Python-mode (ä¸ã¨åºå¥ãã¦)python-mode.el ã¨å¼ã°ãã¦ããã® http://launchpad.net/python-mode ä»ã¾ã§å ¨ç¶ãããªãã£ãã®ã§æ¨æºã§å ¥ã£ã¦ãã®ã使ã£â¦
ãªããè²ã æ¹æ³ã¯ããã®ã§ãããæºåãããã©ãããã£ãã®ã§ 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 (â¦
ãªãã¨ãããæ¸ãæ¨ã¦ã§ã¯ç¡ããã©å¥ã«ç¶ºéºã«æ¸ããã¨ãæããªãã§æ¸ãã¦ãã½ã¼ã¹ãªã®ã§ Blog ã«è²¼ãã¤ãã¦ãã ãã«ããã id:a2c ããã使ã£ã¦ããããæ¹è¯ãã¦ãããããã¦ã¾ããï¼ï¼ ã¯ã¼ã¤ã½(ãâã)ã¡(ãâã)ã¡(ãâã)ãã¯ã¼ã¤ PS: id:jYoshiori coderepâ¦
ããããã°ã½ã¼ã¹å ¬éãã¦ãªãã£ãã®ã§â¦â¦ èªåç¨ãªã®ã§è²ã å®é¨ããããã¦ã¦ãã¡ããªãã³ã¼ãã§ãï¼ï¼ ä½ãå ¥åããã¨ã¯ãã¹ãã¹ããã¦ã ä½ãå ¥åããã« Return 㧠replies ã表示ããã¾ãã replies ã«ãã ID 㯠tab è£å®ãåºæ¥ã¾ãã Outputz ã«æåæ°ãâ¦
ã³ã³ã½ã¼ã«ã®ã¨ã³ã³ã¼ãã Java ã®ã·ã¹ãã ã¨ã³ã³ã¼ãã£ã³ã°ã«ããããã¨ãè²ã ãããã ãã© ã³ã³ã½ã¼ã«ã®ã¨ã³ã³ã¼ãå¤æ´ã¨ãä»ã«å½±é¿åºã¾ãããªã®ã§ ãããªé¢æ°ã¤ãã£ã¦ç¡çç¢çåé¿ããã import sys def p(data): if sys.platform.find('java') > -1: impâ¦
>>> import twitter >>> twitter.Api() <twitter.Api object at 0xb7d1bbec> >>> a = _ >>> b = twitter.Api() >>> a == b False >>> a.GetUser <bound method Api.GetUser of <twitter.Api object at 0xb7d1bbec>> >>> c = _ >>> d = b.GetUser >>> d <bound method Api.GetUser of <twitter.Api object at 0xb7d1be8c>> >â¦</bound></bound></twitter.api>
ããã«ã¨ã¦ãæå¿«ãªè«æ ãããã"self"ãæ示çã«å¼æ°ã¨ãã¦è¨è¿°ãããã¨ã«ãã£ã¦ï¼ä»¥ä¸ã®2ã¤ã®é¢æ°å¼ã³åºããè«ççã«åãã§ãããã¨ãè£å¼·ã§ããï¼ã¨ããã®ã§ãããã¤ã¾ãï¼ã¡ã½ããfooã¯ã¯ã©ã¹Cã®ã¤ã³ã¹ã¿ã³ã¹ã§ãããã¨ãè«ççã«ç¤ºããããã ãfoo.methâ¦
10/25 16:30 ã¾ã§ãäºç®ã¯ 1 ä¸åãããã§ãé¡ããã¾ããåä½ãæ¸ããã¨ï¼ï¼ ï¼è²ã·ã¥ã¼ã¯ãªã¼ã 29å ãããã¼ã¿ã¼ã³ 3è¢ çã¿æ§ããã®ãã§ã³ã¬ã¼ã 2è¢ ããã 6æ¿ ã½ãããµã©ã 3è¢ ãã§ã³ã¬ã¼ãï¼æ¿ãã§ã³ããã¾ãçããªããã¤ï¼ 3æ ã¦ã¼ãã³è¶1.5L 2æ¬â¦
ä»äºããã£ã¦ããåæµ emacs ã®å ¨ç»é¢è¡¨ç¤º ç§çããå¤æ´ã«ãªã£ã ;; Maximixe window size (when (featurep 'carbon-emacs-package) (set-frame-parameter nil 'fullscreen 'fullboth)) ãªããä¸ãããã¡ããï¼ï¼ iTerm ãæè¿ã¹ãã©ã·ã¹ã®ã«ããã 軽ãã£ã¦â¦
pit ã oneliner ã«ãã¦ã¿ãã!! ä»£å ¥ã¯ lambda ã§ã¯åºæ¥ãªãã®ã§ ã¨ãããããã¹ã¦ã°ãã¼ãã«ã«å ¥ãã¦ã¿ãã global ã®ä½¿ããã >>> g = globals() >>> g.__setitem__('x',1) >>> print x 1 ãã!! å¤æ°ã¸ã®ä»£å ¥ã¯ãã¹ã¦ã°ãã¼ãã«ã¸ g = globals() g.__setâ¦
Javaã«ããã¢ã«ã´ãªãºã äºå ¸ä½è : 奥ææ´å½¦,æ浦æ¹ç´,æ´¥çåç,é¦è¤ä¸å¹¸,åæå±ä¹åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾çºå£²æ¥: 2003/05ã¡ãã£ã¢: åè¡æ¬è³¼å ¥: 2人 ã¯ãªãã¯: 61åãã®ååãå«ãããã° (60件) ãè¦ãã® P.60 ã®ã¯ã¤ãã¯ã½ã¼ãããã£ã¦ã¿ãã #!/usr/bâ¦
id:amachang 㨠id:nishiohirokazu ã¨è©±ãã¦ãæã«å®å ¨æ°ã®è©±é¡ãã§ãã #!/usr/bin/env python # -*- coding: utf-8 -*- def isPerfect(value): if value < 2: return False measure = [] for i in xrange(1,value /2 + 1): if value % i == 0: measure.appâ¦
Javaã«ããã¢ã«ã´ãªãºã äºå ¸ä½è : 奥ææ´å½¦,æ浦æ¹ç´,æ´¥çåç,é¦è¤ä¸å¹¸,åæå±ä¹åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾çºå£²æ¥: 2003/05ã¡ãã£ã¢: åè¡æ¬è³¼å ¥: 2人 ã¯ãªãã¯: 61åãã®ååãå«ãããã° (60件) ãè¦ãã® P.249 ã®ããã«ã½ã¼ãããã£ã¦ã¿ãã #!/usr/biâ¦
Javaã«ããã¢ã«ã´ãªãºã äºå ¸ä½è : 奥ææ´å½¦,æ浦æ¹ç´,æ´¥çåç,é¦è¤ä¸å¹¸,åæå±ä¹åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾çºå£²æ¥: 2003/05ã¡ãã£ã¢: åè¡æ¬è³¼å ¥: 2人 ã¯ãªãã¯: 61åãã®ååãå«ãããã° (60件) ãè¦ãã® P.178 ã®ç´ å æ°å解ããã£ã¦ã¿ãã #!/usr/bin/â¦
ãªãã¨ãªãããã£ãããªãã ãç´ å æ°å解ã£ã¦ä¿ºãã©ããã£ã¦ãã®ï¼ã ã¨åçªã«æãã¾ããã ã¾ããå°ããç´ æ°ããé ã«å²ãç®ãã¦ãã£ããããããªãããï¼ ã¨ãæã£ããã§ããããã以å¤ã®æ¹æ³ãæãããããªãã¦å¹ãã ã®ã§ ã¨ããããä½ã調ã¹ãã«èªåã§æ¸â¦
ãã Twitter ã«ã¯æ»ããªã!! ã¾ã Twitter ãªã®?ç«¥è²ã£ã½ãã!! å ¨ç±³ãã³ãã¼1ããã!! ã§æå㪠Wassr ã«å¿åã§æ稿åºæ¥ã AnonymousWassr ã¨ããã®ãä½ã£ã¦ã¿ã¾ãããhttp://gree.appspot.com/ ä½æã«ãããæµã æããããã â ãªããããæ°ãåºãªãã®ã§â¦
DDNS ã®æ´æ°ã£ã¦åãç°¡åãªãã ãã©ãååãã IP ã¢ãã¬ã¹å¤ã£ããã©ããã¨ã æ³¥èããã¡ã¤ã«ã«åã£ã¦ããããããå¦çæ¸ãã®ãããã©ãããã£ãããããã ãã© Pit ã§ãã£ã¦ã¿ããã·ã³ãã«ã ã£ãã®ã§è²¼ã£ã¦ã¿ãã #!/usr/bin/env python # -*- coding: utfâ¦