Pythonを始めたばかりのユーザーの多くが、どちらのバージョンを使えばいいのか迷っています。私の答えは、「気に入ったチュートリアルに書かれているバージョンにしましょう。そして、あとで違いを調べてください」という言葉につきます。 それでは、新しいプロジェクトを始めるときにはどちらを選べばいいのでしょうか? 使おうとしているライブラリを全てサポートしているなら、2.7.x系と3.x系のどちらを使ってもよいでしょう。そうはいっても、この2つのメジャーバージョンについて大きな違いを見ておくのは良いでしょう。どちらかのみでコードを書いたり、プロジェクトに使おうとしている時によくある落とし穴を避けられるからです。 __future__ モジュール Python 3.x で導入されていて Python 2 で使えないキーワードについては、 __furute__ モジュールをインポートすることで Pyt
peps: 76d43e52d978 Python 2.7のThe End Of Life時間(EOL、日没の時間)は5年間延長されて、2020年になった。この決定はPython 2.7の状態を明確にし、まだPython 3に移行出来ない利用者の懸念を取り除くものである。PEP 466も参照されたし。 この表明は、バグ修正リリースが頻繁に行われることを保証するものではないが、Python 2.7のバグ修正を行いたいボランティアの貢献を可能にし、また、今後もしばらくPython 2をサポートする必要のあるベンダーを満足させるものであろう。 Python 2.8はない。 いかにプログラミング言語にとって、下位互換性が重要化が分かる事例だ。Python 3は、下位互換性をぶち壊す変更をすべきではなかった。たとえどんなに汚かろうが、一度使われてしまった文法は、いまさら廃止することは出来ないのだ。
Since I started learning Python, I've kept a list of "tricks". Any time I saw a piece of code that made me think "Cool! I didn't know you could do that!" I experimented with it until I understood it and added it to the list. This post is a summary of that list. If you are an experienced Python programmer, chances are you already know most of these but you might still find a few surprises. If you a
Dynamic instrumentation toolkit for developers, reverse-engineers, and security researchers. Scriptable Inject your own scripts into black box processes. Hook any function, spy on crypto APIs or trace private application code, no source code needed. Edit, hit save, and instantly see the results. All without compilation steps or program restarts. Portable Works on Windows, macOS, GNU/Linux, iOS, wa
I can't for the life of me get Python's relative imports to work. I have created a simple example of where it does not function: The directory structure is: __init__.py start.py parent.py sub/ __init__.py relative.py /start.py contains just: import sub.relative /sub/relative.py contains just from .. import parent All other files are blank. When executing the following on the command line: cd / pyt
これは Python3 Advent Calendar の記事です。夢はテストエンジニアです!ということでユニットテストについて書きます。 Python3 縛りとのことですが、この新ユニットテストフレームワークは Python 3.2 以降と 2.7 以降が対象です。これ以前のバージョンでこの新ユニットテストフレームワークを利用したい場合は、それぞれ unittest2py3k (3 系)、 unittest2 (2 系) というバックポートが用意されています。新ユニットテストは mock や IronPython 等の開発者としても知られている Michael Foord 氏を中心に開発されました。 >>> Python とユニットテストの歴史 Python のユニットテストは、1999 年 xUnit ファミリーの PyUnit として開発され、2001 年に公開された Python
Welcome to Invoke’s documentation!¶ This site covers Invoke’s conceptual & API documentation. For basic info on what Invoke is, including its public changelog & how the project is maintained, please see the main project website. Getting started¶ Many core ideas & API calls are explained in the tutorial/getting-started document:
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work. Try for free Learn more
誰もが一度使うと便利さと気軽さに感動するRubyが誇るライブラリ、 Rake 。 プログラムのビルドもそうなんですが、雑多なタスクを簡単に書けて、整理できるのがなんといっても魅力的。RailsなんかではDBの作成から何から、ばんばんRakeタスクにされていますよね。 さて、俺はPythonistasなので、PythonでRakeみたいなのがほしいわけです。ビルドに限っていえばPythonは Scons という素晴らしいツールがあります。C言語はおろか、JAVA、PDF、PostScriptなどなど、さらにはSubversionもサポートしていますし、並列コンパイルもでき、実績も多数で申し分ありません。 でも俺がしたいのは、雑多なタスクを放り込む、コレ。そういうのを簡単にやるライブラリってPythonではないんでしょうか。RubyではRakeが標準添付されるというのに。いえ、あります。前から
What is SCons? SCons is an Open Source software construction tool. Think of SCons as an improved, cross-platform substitute for the classic Make utility with integrated functionality similar to autoconf/automake and compiler caches such as ccache. In short, SCons is an easier, more reliable and faster way to build software. What makes SCons better? Configuration files are Python scripts--use the p
Downloads Get Started with Pip $virtualenvtry-twisted $ . try-twisted/bin/activate $ pip install twisted[tls] $ twist --help Download Direct from PyPI https://pypi.org/project/Twisted/ Optional Dependencies Install Extras Community See the code for Twisted (and more) on GitHub Read our blog Join the discussion list Come chat with us on IRC Report a 🔒security issue Ask on Stack Overflow Fo
1月に「Pythonを始めるなら、1ファイルの軽量Webフレームワーク「Bottle」がおすすめ」というのを書いたところ、なかなか反響が大きかった。そこで今回は、私がいくらか使ったことがあるPythonのWebフレームワーク6種について、かんたんに紹介するというのをやってみたい。コメントは、私のごく主観的な印象に基づいている。 Bottle(ボトル) http://bottlepy.org/ 「bottle.py」という1ファイルだけでできている。環境構築が不要なので、Python入門に最適。1ファイルに全部入っているので、組み込むのも容易だし、依存リスクもないので、実用にもいいと思う。これだけシンプルなのは、生存戦略としても強い。 CherryPy(チェリーパイ) http://cherrypy.org/ Bottleより大きいが、外部依存がないので、これも環境構築不要で、Python入
Welcome to Flask¶ Welcome to Flask’s documentation. Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications. Get started with Installation and then get an overview with the Quickstart. There is also a more detailed Tutorial that shows how to create a small but complete application with Flask.
Not your computer? Use a private browsing window to sign in. Learn more about using Guest mode
What is gevent?¶ gevent is a coroutine -based Python networking library that uses greenlet to provide a high-level synchronous API on top of the libev or libuv event loop. Features include: Fast event loop based on libev or libuv. Lightweight execution units based on greenlets. API that re-uses concepts from the Python standard library (for examples there are events and queues). Cooperative socket
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く