Cheat Sheet: Writing Python 2-3 compatible code¶ Copyright (c): 2013-2024 Python Charmers, Australia. Author: Ed Schofield. Licence: Creative Commons Attribution. A PDF version is here: https://python-future.org/compatible_idioms.pdf This notebook shows you idioms for writing future-proof code that is compatible with both versions of Python: 2 and 3. It accompanies Ed Schofield’s talk at PyCon AU
greenlet: Lightweight concurrent programming# What are greenlets? greenlets are lightweight coroutines for in-process sequential concurrent programming. greenlets can be used on their own, but they are frequently used with frameworks such as gevent to provide higher-level abstractions and asynchronous I/O. greenlets are frequently defined by analogy to threads or Python’s built-in coroutines (gene
Python のバリデータだと、以前このブログでも FormEncode を扱ったことがある。 今回は同様のパッケージとして jsonschema について書いてみる。 まず、元々の “jsonschema” というものは JSON の構造を JSON で記述するための仕様を指している。 そして、今回紹介する Python パッケージの jsonschema は、その仕様を元にバリデータを実装したものだ。 元々の “jsonschema” の仕様については以下の Web サイトを参照してもらいたい。 http://json-schema.org/ まずインストールは PyPI から。 $ pip install jsonschema jsonschema のバリデーション・ルールは辞書と文字列で記述する。 詳しくは json-schema.org の仕様を確認すると良いが、以下のサンプルに
Pinterest is an equal opportunity employer and makes employment decisions on the basis of merit. We want to have the best qualified people in every job. All qualified applicants will receive consideration for employment without regard to race, color, religion, sex, sexual orientation, gender identity, national origin, disability, protected veteran status, or any other characteristic under federal,
Psycopg – PostgreSQL database adapter for Python¶ Psycopg is the most popular PostgreSQL database adapter for the Python programming language. Its main features are the complete implementation of the Python DB API 2.0 specification and the thread safety (several threads can share the same connection). It was designed for heavily multi-threaded applications that create and destroy lots of cursors a
Introducing Pyston: an upcoming, JIT-based Python implementation Hello everyone, I’m very excited to announce Pyston, a new open-source implementation of Python, currently under development at Dropbox. The goal of the project is to produce a high-performance Python implementation that can push Python into domains dominated by traditional systems languages like C++. Here at Dropbox, we love Python
Validation with lxml Apart from the built-in DTD support in parsers, lxml currently supports three schema languages: DTD, Relax NG and XML Schema. All three provide identical APIs in lxml, represented by validator classes with the obvious names. lxml also provides support for ISO-Schematron, based on the pure-XSLT skeleton implementation of Schematron: There is also basic support for pre-ISO-Schem
Python 2.7.2 serializer speed comparisons Jul 25, 2012 In a recent python project where I was sending multiple messages per second of data over a basic socket, I had initially just grabbed the cPickle module to get the prototype proof-of-concept functioning properly. cPickle is awesome for easily serializing more complex python objects like custom classes, even though in my case I am only sending
「HackerNews翻訳してみた」が POSTD (ポスト・ディー) としてリニューアルしました! この記事はここでも公開されています。 Original article: Saying Goodbye To Python by Ian Bicking ずっと先延ばしにしてきた記事を書きます。決別宣言ではなく(ずいぶん前に離れていますし)、ただ自分が歩んできた道を振り返ったに過ぎません。Pythonの世界に別れを告げてずいぶん経つのに、これまでサヨナラを言う勇気がなかったのです。 何年も前にPythonを卒業したとはいえ多少の愛着は残っており、戻る可能性もあると思っていました。PyCon 2013への提議が却下されたことは頭にきましたが(面白い話をしようと思っていたのに!)、この件で自分はもうPythonコミュニティの一員ではないのだと確信しました。 Pythonは私が初めて(もしかした
This post is long overdue; this isn’t a declaration of intent (any intent was long ago made real), just my reflection about my own path. I left the Python world a long time ago but I never took a chance to say goodbye. While I had moved on from Python years ago, I felt a certain attachment to it well past then, not quite admitting to myself that I wasn’t coming back. When my proposal for PyCon 201
I'd like to play around in a virtual environment that's being interpreted purely via python3.3. On my system (Ubuntu 13.04), there are two ways to create a virtual environment. virtualenv env or: pyvenv-3.3 env If I use the old faithful, virtualenv, I'm able to use everything as expected, however, PIP installs everything into python2.7 libs rather than python3.3 libs. So, calling scripts using pyt
はてなグループの終了日を2020年1月31日(金)に決定しました 以下のエントリの通り、今年末を目処にはてなグループを終了予定である旨をお知らせしておりました。 2019年末を目処に、はてなグループの提供を終了する予定です - はてなグループ日記 このたび、正式に終了日を決定いたしましたので、以下の通りご確認ください。 終了日: 2020年1月31日(金) エクスポート希望申請期限:2020年1月31日(金) 終了日以降は、はてなグループの閲覧および投稿は行えません。日記のエクスポートが必要な方は以下の記事にしたがって手続きをしてください。 はてなグループに投稿された日記データのエクスポートについて - はてなグループ日記 ご利用のみなさまにはご迷惑をおかけいたしますが、どうぞよろしくお願いいたします。 2020-06-25 追記 はてなグループ日記のエクスポートデータは2020年2月28
みんなのIoT/みんなのPythonの著者。二子玉近く160平米の庭付き一戸建てに嫁/息子/娘/わんこと暮らしてます。月間1000万PV/150万UUのWebサービス運営中。 免責事項 プライバシーポリシー 手前味噌ですが、先日のるびまの巻頭言と比べると、Pythonな人とRubyな人の違いがよく出てるんじゃないかなあ、という気がしました。ちょっと偏見が入っていますが。 両者は、どちらの方が良いか、みたいな話ではなく、あくまで適性というか、求めるもの、目指すところの違いの話で。たぶん二人とも同じ光景を見てるんだと思うのですが、私が「1.8.6もいいけど、やっぱり1.9.1もいいよね」と表現するところを、柴田さ んなら「1.9.1もいいけど、やっぱり1.8.6もいいよね」と表現するんだろうなあ、と。 Pythonな人とRubyな人の違い PythonistaもRubyistも,一般的な「開発
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く