so tired

仮想化、ハードウェアなどの技術メモ

python

文字列⇔バイナリ変換

文字列→バイナリ バイナリ→文字列 >>>chars = list(map(hex, map(ord, "hello"))) >>>chars ['0x68', '0x65', '0x6c', '0x6c', '0x6f'] >>>result = '' >>>for i in chars: ... result += chr(int(i, 16)) ... >>>result 'hello'

BeautifulSoupを試してみた

年末年始はpythonの勉強をしよう!ということで、BeautifulSoupでスクレイピングを試してみた。 インストールの準備 まずはBeautifulSoupを利用する環境を整える。 BeautifulSoupのインストールにeasy_installコマンドを利用するためsetuptoolsをインストー…