プログラミング言語Pythonの特徴、言語仕様、Python 2と3の違い、よく使うライブラリ、パッケージ、今後の学び方などについての発表資料です

こんにちわ。日々の作業の80%がターミナルで完結する原です。 最近、他チームに向けてCLI(コマンドライン・インタフェース)ツールを作成する機会がありました。 ツール動作環境がOS Xである点、モジュールのインストールが簡単である点、内部DSLの実装が比較的用意である点などを考慮し、Pythonで実装・配布しました。 また、自分自身も、普段の開発で行うような定形作業をPythonでスクリプト化することで、効率化しています。 シェルスクリプトでは実装が面倒くさいような外部サービスとの連携も、Pythonであればサードパーティのモジュールや例がたくさんあるため、実装が容易です。 当エントリでは、このように色々なシーンで活用できるPython製CLIツールの実装および配布方法をご紹介します。 サンプルとして「wonder_tool」という名前のCLIツールを作ってみましょう。 サンプルの仕様 こ
Welcome to Python for you and me¶ This is a simple book to learn Python programming language, it is for the programmers who are new to Python. You can find the latest version of the book here. If you are new to command line in Linux, you can read lym. Contents: pym is a book to learn Python. It targets people who are completely new to the language. Feedback is greatly appreciated. If you have any
世界には1行でプログラムを書くワンライナーという技巧的プログラミングの世界があります。 ワンライナーと言われる言語の多くはPerlやRubyなのですが、委員長キャラのPythonでもワンライナーができます。 PEP8とZen of Pythonで綺麗になっているPythonicな世界に Pythonでも1行で書いたよ!楽しい!! ✌('ω'✌ )三✌('ω')✌三( ✌'ω')✌ などと技巧プログラミングをする闇Pythonista(私)がテクニックなどもろもろをまとめたものがこの記事になってます。 まだPython力を鍛えている途中のわたしなのでなにか指摘などありましたらコメントをいただければです。 対象読者 Pythonをある程度かける人 Pythonの細かい挙動に興味のある人 白Pythonに飽きてしまった人 テクニック1:代入文を式にする Pythonでの代入は基本改行が必要です。
IPython provides a rich architecture for interactive computing with: A powerful interactive shell. A kernel for Jupyter. Support for interactive data visualization and use of GUI toolkits. Flexible, embeddable interpreters to load into your own projects. Easy to use, high performance tools for parallel computing. To get started with IPython in the Jupyter Notebook, see our official example collect
やりたいこと Redisをセッションデータの保存先にしたい Beakerって? 様々なデータストアにセッションデータを保存するWSGI Middleware。WSGIレイヤーなのでFlask以外のWAF(bottleとか)でも使えるはず。 必要なもの Python 2.6+ (自分はPython 3.3.4で動かしてる) Flask Beaker beaker_extensions - beakerだけだとRedisには対応してないためこれが必要 redis-py Redis サンプルコード gist9811874 動かす $ pip install beaker flask redis git+git://github.com/bbangert/beaker_extensions.git $ python beaker_sample.py http://localhost:5000/ に
Python のデバッガといえば言語そのものに付属している pdb がまず挙げられるけど、pdb は実行中の行以外を確認できなくて正直かなり使いづらさを感じる。 それ以外の Python のデバッガとしては、以前にこのブログでも winpdb を紹介しているし、それ以外だと Eclipse PyDev プラグインの GUI デバッガをよく使っている。 とはいえ、これら二つは動作に X Window System が必要だったり、プラットフォームとして Eclipse や wxPython をインストールしなきゃいけないのが結構手間になる。 今回紹介する PudB は動作に特別なプラットフォームが不要でなおかつ pdb より便利な CUI のデバッガだ。 インストールはいつも通り PyPI から PIP で。 必要に応じて sudo などする。
Unverified details These details have not been verified by PyPI Project links Homepage Meta License: MIT License (MIT) Author: Benjamin Peterson Requires: Python !=3.0.*, !=3.1.*, !=3.2.*, >=2.7 Classifiers Development Status 5 - Production/Stable Intended Audience Developers License OSI Approved :: MIT License Programming Language Python :: 2 Python :: 3 Topic Software Development :: Libraries Ut
iOS用のアプリは通常、開発アカウントを取得し、Macを使って開発します。 開発アカウントを取得するほどではないが、iOSデバイス上で何かやりたい処理がある、という人はいるでしょう。 あるいは、プログラム好きな人なら率先してiOSデバイス上でプログラミングをしたいと思うのではないでしょうか。 そうしたニーズに存分にこたえることができる、iOSデバイス上で動作する統合開発環境がPythonista 3です。 2016年9月21日に開催されたPyCon JP 2016で @equal_001 さんがPythonistaについて発表されていたのでご紹介。 Python支持者のことをPythonistaといいますが、アプリ名はそこから取ったんでしょうね。 正真正銘のPythonが内蔵されていて、ローカルで動きます。 [参考] Kazuhiro AbeさんはTwitterを使っています: 「インタプ
Here on CheckiO we are creating games for coders. We have made py.checkio.org and js.checkio.org where you can improve your TypeScript and Python coding skills. We have also created Empire of Code - a space game with a mix of strategy, tactics and coding. In addition to the 50k monthly active Python and TypeScript players, who are constantly improving their skills by engaging in CheckiO missions a
Welcome to the Python Packaging User Guide, a collection of tutorials and references to help you distribute and install Python packages with modern tools. This guide is maintained on GitHub by the Python Packaging Authority. We happily accept contributions and feedback. 😊 Overview and Flow¶ Note Building your understanding of Python packaging is a journey. Patience and continuous improvement are
生まれてはじめて PyPI にコードを登録した。Python 2.7 と 3.3 で使えるようにするにあたり、ライブラリの実装とは直接関係ないところで、とまどった。現時点での手順を記録しておく。 以下を前提とする。 OS X 10.9.1 (Mavericks) homebrew でパッケージを管理 pyenv, pyenv-virtualenv で OS 上の Python 環境を管理 PyPI に登録するライブラリは Python 2.7 と 3.3 に対応 まず始める shimizukawa によるハンズオン資料と公式ドキュメントを併読しながら進める。基本的な作業はハンズオンでだいたい分かる。とはいえ、あなたが持っているライブラリは、必ずしもチュートリアルどおりではないだろうから、公式ドキュメントのガイドが必要になるだろう。 ところで、ナウなヤングは egg じゃなくて wheel
Contents URLディスパッチ PyramidでのURLディスパッチ View Predicate ルートURL トラバーサル オブジェクトのデフォルトビュー ビュー名 リソースURL URLディスパッチとトラバーサルの比較 URLディスパッチとトラバーサルの混合 軽いURLディスパッチ + がっつりトラバーサル ガッツリURLディスパッチ + 軽くトラバーサル まとめ とりあえずコントローラースタイルと書いたが、ようするにWebアプリケーションがリクエストを受け取ってから処理に入るまでの流れである。 Pyramidはあえて複数の方法を採用している。その他のフレームワークから来る人たちがお気に入りの方法をとれるようにするためだ。 大きく分けて、Zope系由来のトラバーサル、DjangoやPylonsが使っているURLディスパッチがある。 (TurboGearsはPylons上のフレー
Practical Python Projects book is now available! Learn how to implement 12 end-to-end projects to enhance your Python knowledge. Source Python 101: Writing a cleanup script January 23, 2014 So hi there guys! I hope you are fine. So what is in this post? Today we will be writing a cleanup script. The idea for this post came from Mike Driscol who recently wrote a very useful post about writing a cle
How to Run Unit Tests in Python Without Testing Your Patience More often than not, the software we write directly interacts with what we would label as “dirty” services. In layman’s terms: services that are crucial to our application, but whose interactions have intended but undesired side-effects—that is, undesired in the context of an autonomous test run. For example: perhaps we’re writing a soc
INDEX コーディングスタイル ファイル操作 日付・時刻 その他 その他 .pycを作りたくない 環境変数PYTHONDONTWRITEBYTECODEを設定すると、.pycおよび.pyoファイルが作成されなくなる。値は何でもいいので、 export PYTHONDONTWRITEBYTECODE=1 などと書いておけばよい。 辞書(dict)のソート キー(key)の順に取り出す >>> score = {'Jack':300, 'Mike':200, 'Jane':100} >>> for (k, v) in sorted(score.items()): ... k, v ... ('Jack', 300) ('Jane', 100) ('Mike', 200) 値(value)の順に取り出す >>> for (k, v) in sorted(score.items(), key=l
More About Unicode in Python 2 and 3 written on Sunday, January 5, 2014 It's becoming increasingly harder to have reasonable discussions about the differences between Python 2 and 3 because one language is dead and the other is actively developed. So when someone starts a discussion about the Unicode support between those two languages it's not an even playing field. So I won't discuss the actual
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く