Archives

You are currently viewing archive for March 2009
Category: Web dev
Posted by: hajime osako
javascript:Q='';x=document;y=window;if(x.selection){Q+=x.selection.createRange().text;}else if(y.getSelection){Q+=y.getSelection();}else if(x.getSelection){Q+=x.getSelection();}w=window.open('','_blank','width=600,height=250');f=w.document.createElement('form');f.setAttribute('action','<?echo Utilities::buildUrl(true);?>/bookmarkletPage.php?logtext='+escape(Q)+'&loglink='+escape(x.location.href)+'&logtitle='+escape(x.title));f.setAttribute('method','POST');i=w.document.createElement('input');i.setAttribute('type','hidden');i.setAttribute('name','ihtml');i.setAttribute('value',encodeURIComponent(x.documentElement.innerHTML));f.appendChild(i);w.document.documentElement.appendChild(f);w.focus();f.submit();"
Category: Web dev
Posted by: hajime osako
Category: Web dev
Posted by: hajime osako
Python: テキストファイルに書き込み - write()、writelines()メソッド - Yukun

09.f = open('text.txt', 'w') # 書き込みモードで開く
10.f.write(str) # 引数の文字列をファイルに書き込む
11.f.close() # ファイルを閉じる

convert dict to str = str(dict)
format dict = import ppritn; pprint.pformat(dict)
Category: Web dev
Posted by: hajime osako