â
WINDOWSä¸ã§æ¸ãããShift-JISã®ããã¹ããã¡ã¤ã«ãLINUXä¸ã§è¡¨ç¤º
1 #!/usr/bin/python 2 # coding: utf-8 3 4 import codecs 5 import re 6 import sys 7 8 hoge = codecs.open('data/TESTB.txt','r','shift_jis') 9 sys.stdout = codecs.getwriter('euc_jp')(sys.stdout) 10 11 12 for l in hoge : 13 print l
shift_jisã§ãã¡ã¤ã«ãéãã¦ãeuc_jp(èªåã®ç°å¢ãEUCã ã£ã)ã§æ¸ãã°ããã
â
åè«ããã«
èªåã²ã¨ãã§è§¦ãã«ã¯ä»ç®ç´ã§ååã§ã¯ãªããã¨ãã
大人æ°ã§æ
å ±ãæ´çããã®ã«ã¯ä¾¿å©ã ãã©ãä¸äººã ã¨å¨åãçºæ®ããªãæ°ããã¦ããããã
aptã§ã¤ã³ã¹ãã¼ã«ãããã®ã£ã¦çµæ§å¤ãã£ãã(0.8.1)ææ°ã¯0.10ãããã
(追è¨)
subversion使ãåºããããçµæ§ä½¿ããããã£ã¦æã£ãã
â
pymixiããã触ããpythonã¹ã¯ãªããããmixiãåãããã¨ãã§ããã
以ä¸ããæ¹
- 以ä¸ããpymixiã®ã½ã¼ã¹ããã¦ã³ãã¼ã
http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/pymixi/
http://www.crummy.com/software/BeautifulSoup/
- 解åãã¦Beautiful Soupãã¤ã³ã¹ãã¼ã«
$ tar zxvf BeautifulSoup-3.0.3.tar.gz $ cd BeautifulSoup-3.0.3 $ python setup.py install
pymixiã解åããã¨pymixiãã©ã«ãé
ä¸ã«ã¹ã¯ãªããã転ãã£ã¦ããã®ã§ããããåããã°ããã
èªåã解åãããããããªæãã ã£ãã
friend_diary.py mixi.py new_bbs.py show_log.py image.py mixi.pyc profile.py list_frind.py mixi2rss.py result.txt list_message.py mixidiary2txt.py search_diary.py
ãã¤ãã¯ã·ã£ææ°æ¥è¨ãè¦ã¦ã¿ãã
$ python mixidiary2txt.py -u MAILADDRESS -p PASSWORD
ç¡äºã«è¦ãã¾ããã¨ããæ稿ãã§ãããã©ãWEBä¸ã§å¥ã«ä¸æºã¯ãªããã¨ã«æ°ã¥ãã
â
lhzãã¡ã¤ã«ã解åãå§ç¸®ããããã®lhaã³ãã³ããã¤ã³ã¹ãã¼ã«ããã
$ apt-get install lha
ããããªãã£ã¦ãããããã¨æã£ã¦ãããã調ã¹ãã¨non-freeã®ãã®ãããã
/etc/apt/sourcelistã®ãã©ã¼ã®æå®ã®æå¾ã«non-freeã£ã¦è¿½å ãã¦
ä¸åupdateãã¦å度ãã£ããã¤ã³ã¹ãã¼ã«ã§ããã