著者 神嶌 敏弘 (Toshihiro Kamishima) リリース 2020-02-17 08:56:35 +0900 ダウンロード用 [ PDF版 ] [ ePub版 ] ソースレポジトリ [ https://github.com/tkamishima/mlmpy ]
It's great that many software conferences nowadays put their videos online, DjangoCon has been especially good on this. Those who can't attend the real conference for budget or geographical reasons get a chance to experience some great presentations. It's great for pushing the overall web development level upward. I collected here mainly DjangoCon presentations, but there are a few other quality t
Speed, reproducibility, easy rollbacks, and predictability is what we strive for when deploying our diverse Python applications. And that’s what we achieved by leveraging virtual environments and Linux system packages. Preamble and disclaimerA note from 2017A lot has changed since 2012 when this article was written. However in the grand scheme of things, it’s still relevant as before. So while we’
はじめに こんにちは、Python界の情弱です。前回はJenkinsを導入するところまで。今回はPythonで書かれたプロジェクトのテストを走らせて結果を表示するまで。pytestを使った場合の結果の取得方法を調べたのでメモ。 前回のエントリはこちら。 参考 Using Tox with the Jenkins Integration Server — tox 1.4-1 documentation ここに全部書いてあるので特に困ることはなかった 準備 まずテストを走らせるためにCIが実行するスクリプトが必要。Jenkinsはユーザjenkinsで動いているためそいつにPythonとかGitの設定をしてやらないといけない。 Gitの設定 GitHubにアクセスするときはempty identだとエラーになるので設定しておく。Gitのユーザ名とメールアドレスをJenkinsの管理画面で設定し
patch はコンテクストマネージャでもあるので、with を使った書き方ができます。with でつくられたブロックの中でだけ、モックが機能するようになります。 >>> from mock import patch >>> with patch('random.random') as m: ... import random ... random.random() # もうモックになっている。戻り値は Mock オブジェクト ... m.return_value = 0.5 ... random.random() # 戻り値は 0.5 ... <mock.Mock object at 0x423ed0> 0.5 >>> random.random() # モノホンの random 関数 0.84432022018162511 with ブロックの中に入った時点で、random.random
We’ve been working on Phusion Passenger 3.2 on local repositories for a while now. Today we just pushed this code to Github. You can find it in the experimental branch. Despite the relatively minor version bump, Phusion Passenger 3.2 has actually received a major internal overhaul. This is because our version number growth rate is based on the quantity of user-visible improvements, not internal (t
quickrun 現在のバッファの内容をファイル名に結びついた言語のコマンドで実行してくれる(e.g. foo.pyならpython) https://github.com/syohex/emacs-quickrun motivate pythonを書くときには、virtualenvでプロジェクトごとに環境を分けている。 なので以下のようなことがquickrunでもできたら良いなと思った。 ~/venvs/poject1/foo/bar.pyでは~/venvs/project1/bin/pythonを利用して欲しい。 ~/venvs/poject2/boo/boo.pyでは~/venvs/project2/bin/pythonを利用して欲しい。 一方で、quickrunのpythonの設定を見ると、:command "python"とpython決め打ちだったのであまり良くない。 how
optparseからargparseに変更。 1 tonicdnscli のPython 3への対応をしようとした際、コマンドラインオプションに使用している optparseモジュールがPython 2.7 で廃止予定だということを知りました。そこで、optparseからargparseに変更することにしました。optparseでは、入力ファイルをJSON形式で表示させるためのオプションや、TonicDNSからレコードを取得して表示、レコードの登録、レコードの削除を行うのをオプションで行っていましたが、argparseに変更するタイミングで、これらをサブコマンドとして実装しなおしました。変更した結果が下記の表です。 機能 optparse argparse 変換・表示 -o/–stdout show 取得表示 -g/–retrieve get レコード登録 -c/–create creat
以前 Lua の処理系 LuaJIT が速くて羨ましいという話を書いたが,最近は Python でも JIT コンパイラ PyPy の性能向上が著しいようだ.どれぐらい速いかというと,以前実験した PA-I(機械学習)で LuaJIT での実行速度を上回るぐらい*1.Python はもともとスクリプト言語の中では実行速度が速い方だったが,PyPy の急速な性能向上によって Perl や Ruby といった競合言語に対して(実行速度の点で)差を広げつつあるようだ. そういうわけで,最近スクリプトを Python で書く機会が増えている.Python でコードを書く上でやっかいなのは(まともな)ワンライナーが書けないこと*2と,(処理系のバラつきに起因する)移植性の問題である.前者はどうにもならないので,perl / ruby / sed + awk などで回避することになるが,後者は公開する
$ pip install nose $ pip install mock $ pip install coverage $ pip install tox
趣味プログラマです、こんにちわ。一応生きてます。 さて、Pythonista各位におかれましてはmoratoriumをエンジョイされていますでしょうか。そろそろライブラリも著名なものはPython3に対応してきましたし、そろそろ本格的にPython3、となっているころ合いですね。というか、Python3に対応してないとちょっと恥ずかしくなってきましたね。 とはいえ、Python2は根強く残るでしょう。というわけでPython2とPython3両方で動くコードを書きましょう。テストも書くのは当たり前ですし、せっかくなのでCIもしましょう。 と私も最近思ったので快適に開発を進めるための環境についてメモです。 github : 言わずもがなですね。 travis : githubと連携してCIできるサービス。P言語にも対応していて、最近アツいです。 tox : 複数のPython処理系でvirt
Rian Hunter, Engineer - Dropbox Dropbox is a startup company located in San Francisco that has probably one of the most popular file synchronization and sharing tools in the world, shipping Python on the desktop and supporting millions of users and growing every day. Dropbox uses Python on the client-side and server side as well. This talk will give an overview of the first two years of Dropbox, t
Python では、下らない問題は、賢く綺麗に解決しようとせずに、 Python 本体が持っている柔軟さを使って強引に解決する方が楽な場合があります。 問題ごとに綺麗な仕組みを作ってしまうと、新しく Python を覚えるひとは無数にある下らない問題の数だけ用意された仕組みを覚えないといけなくなってしまうからです。 今日は下らない問題の例として、配布するモジュールにバージョン番号をもたせる場合について考えてみます。 # mymodule/__init__.py __version__ = '0.0.1' さて、 setup スクリプトを書きます。 # setup.py from distutils.core import setup setup(name="mymodule", version='0.0.1', packages=["mymodule"], ) バージョン番号を2ヶ所に書い
For full functionality of this site it is necessary to enable JavaScript. Here are the instructions how to enable JavaScript in your web browser.
[The Python version described in this article is 3.x, more specifically - the 3.3 alpha release of CPython.] The concept of a callable is fundamental in Python. When thinking about what can be "called", the immediately obvious answer is functions. Whether it's user defined functions (written by you), or builtin functions (most probably implemented in C inside the CPython interpreter), functions we
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く