はてなグループの終了日を2020年1月31日(金)に決定しました 以下のエントリの通り、今年末を目処にはてなグループを終了予定である旨をお知らせしておりました。 2019年末を目処に、はてなグループの提供を終了する予定です - はてなグループ日記 このたび、正式に終了日を決定いたしましたので、以下の通りご確認ください。 終了日: 2020年1月31日(金) エクスポート希望申請期限:2020年1月31日(金) 終了日以降は、はてなグループの閲覧および投稿は行えません。日記のエクスポートが必要な方は以下の記事にしたがって手続きをしてください。 はてなグループに投稿された日記データのエクスポートについて - はてなグループ日記 ご利用のみなさまにはご迷惑をおかけいたしますが、どうぞよろしくお願いいたします。 2020-06-25 追記 はてなグループ日記のエクスポートデータは2020年2月28
ちょっと前まではrubyで、最近はpythonで仕事をしているので、rubyでやっていたアレ、pythonだとどうやるんだろ?と思うことがたまにあります。 逆にpython書いてて、あれこれrubyで(ry とか で、インスタンス変数の操作ですが、 pythonではあらかじめ定義をしていなくても、インスタンス.変数名に代入することでインスタンス変数をセットすることができます またインスタンスの__dict__に変数名と値が格納されていますので、それを参照することで、インスタンス変数になにが設定されているのか知ることができます python class Person(): def __init__(self, name): self.name = name me = Person('yuhei') # インスタンス変数をセット me.age = 33 # インスタンス変数名の一覧を取得 pr
Beautiful SoupはHTMLやXMLをparseしてくれるパーサーライブラリです。でも、Beautiful Soupは単なるパーサーじゃなくてちょっと賢い奴なんです。 今回、このBeautiful Soupのドキュメントを翻訳しました。 http://www.tdoc.info/beautifulsoup/ 下に軽く紹介していますが、詳しくはこのドキュメントをご覧ください。 Beautiful Soupをざっくり紹介 Beautiful Soupがどういうやつかって?例えばこんなHTMLがあったとしましょう。 <HTML> <body> 改行<br> したいよね <br/> <! --あれ、空白が入ってるちょっと変なコメント--> <p> bodyが閉じてないよ? </html> 結構変なHTMLですよね。でも、巷にはこういうのも結構あるんです。で、これをtest1.htmlだと
最近、仕事でもプライベートでもよくPythonを使っているのですが、ループのやり方が今まで使ってきたJavaScriptやPHPと少し使い勝手が違っていて迷うことがよくあるので防備録としてまとめておきます。 比較対照として、JavaScriptとPHPで同じことをする方法もまとめてみました。 こうやって比較してみるとそれぞれ特徴があって面白かったですよ。 リスト(配列)編 リストの要素を順番に取得する Pythonの場合 単純に、リストに収められている順番に取得するだけなら、for inで回すだけです。 list = ['foo', 'bar', 'baz'] for item in list: print item 実行結果 foo bar baz JavaScriptの場合 forでインデックスを0から1つずつ増加させて参照していきます。 id:amachang曰く、配列では for
最近 Python3 対応のビッグウェーブを個人的に感じるので、複数のバージョン (2 系, 3 系) の Python をインストールできる環境を Mac (OS X 10.8.2) に整備してみた。 使うものとその役割は以下の通り。 - Pythonz (Python 複数バージョンの管理) - virtualenv & virtualenvwrapper (Python 仮想環境の管理) 1. virtualenv, virtualenvwrapper のインストール まずは pip 経由で virtualenv と virtualenvwrapper をインストールする。 $ sudo easy_install pip $ sudo pip install virtualenv{,wrapper} $ pip freeze | grep virtualenv virtualenv=
mzmttks's blog for my memorandum の略で mzrandum. Topics are: python, book review, and my hobbies. Python のインストールパスは、バージョンごと、モジュールごとで異なる。 Python 2.5 以前 public モジュール を python-support でインストール (apt-get) /usr/lib/python2.X/site-packages public モジュールを ローカルでインストール (easy_install) /usr/local/lib/python2.X/site-packages 独自モジュールをローカルでインストール /usr/local/lib/python2.X/site-packages Python 2.6, 2.7 public モジュール を
MOONGIFTはオープンソース・ソフトウェアを紹介するブログです。2021年07月16日で更新停止しました 各種フレームワーク向けにCMSは存在すると思いますが、DjangoはプラグインとしてのCMSはあっても単体としてCMSを提供するシステムがあまり多くない印象があります。自作のDjangoアプリケーションにCMS機能を追加する場合はそれで問題ありませんが、逆にCMSをベースに拡張したいと思う時には不便です。 今回はそんな中登場したDjango製CMS、Wagtail CMSを紹介します。デザイン性に優れた格好いいCMSです。 Wagtail CMSのインストール 今回はWagtailのデモ版を試してみます。Vargrantで配布されていますのでセットアップの手間いらずです。 git clone https://github.com/torchbox/wagtaildemo.git c
Python Testing Python Software Development and Software Testing (posts and podcast) I think of pytest as the run-anything, no boilerplate, no required api, use-this-unless-you-have-a-reason-not-to test framework. This is really where testing gets fun. As with previous intro’s on this site, I’ll run through an overview, then a simple example, then throw pytest at my markdown.py project. I’ll also c
What are the top downloaded pytest plugins? I want to know this. And I’d like the answer updated regularly. So today I decided to write a script to do that for me. Grab data Let’s start with Top PyPI Packages from Hugo van Kemenade. This list is “A monthly dump of the 8,000 most-downloaded packages from PyPI.” Perfect. Parse Now: Filter for “pytest” in the package name Remove “pytest” itself.... p
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く