Files
conductofcode/docs/_build/html/starting/which-python.html
T
Kenneth Reitz bb36a62c50 massive dump
2012-09-02 04:33:29 -04:00

225 lines
10 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Picking an Interpreter &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Properly Installing Python" href="installation.html" />
<link rel="prev" title="News" href="../intro/news.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="installation.html" title="Properly Installing Python"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../intro/news.html" title="News"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="picking-an-interpreter">
<h1>Picking an Interpreter<a class="headerlink" href="#picking-an-interpreter" title="Permalink to this headline"></a></h1>
<p>Which Python to use?</p>
<div class="section" id="x-vs-3-x">
<h2>2.x vs 3.x<a class="headerlink" href="#x-vs-3-x" title="Permalink to this headline"></a></h2>
<p><strong>tl;dr</strong>: Python 2.x is the status quo, Python 3.x is the shiny new thing.</p>
<p><a class="reference external" href="http://wiki.python.org/moin/Python2orPython3">Further Reading</a></p>
<div class="section" id="today">
<h3>Today<a class="headerlink" href="#today" title="Permalink to this headline"></a></h3>
<p>If you&#8217;re choosing a Python interpreter to use, I <em>highly</em> recommend you Use Python 2.7.x, unless you have a strong reason not to.</p>
</div>
<div class="section" id="the-future">
<h3>The Future<a class="headerlink" href="#the-future" title="Permalink to this headline"></a></h3>
<p>As more and more modules get ported over to Python3, the easier it will be for
others to use it.</p>
</div>
</div>
<div class="section" id="which-python-to-support">
<h2>Which Python to Support?<a class="headerlink" href="#which-python-to-support" title="Permalink to this headline"></a></h2>
<p>If you&#8217;re starting work on a new Python module, I recommend you write it for
Python 2.5 or 2.6, and add support for Python3 in a later iteration.</p>
</div>
<div class="section" id="implementations">
<h2>Implementations<a class="headerlink" href="#implementations" title="Permalink to this headline"></a></h2>
<p>There are several popular implementations of the Python programming language on
different back-ends.</p>
<div class="section" id="cpython">
<h3>CPython<a class="headerlink" href="#cpython" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://www.python.org">CPython</a> is the reference implementation of Python,
written in C. It compiles Python code to intermediate bytecode which is then
interpreted by a virtual machine. When people speak of <em>Python</em> they often mean
not just the language but also this implementation. It provides the highest
level of compatibility with Python packages and C extension modules.</p>
<p>If you are writing open-source Python code and want to reach the widest possible
audience, targeting CPython is your best bet. If you need to use any packages
that are rely on C extensions for their functionality (eg: numpy) then CPython
is your only choice.</p>
<p>Being the reference implementation, all versions of the Python language are
available as CPython. Python 3 is only available in a CPython implementation.</p>
</div>
<div class="section" id="pypy">
<h3>PyPy<a class="headerlink" href="#pypy" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://pypy.org/">PyPy</a> is a Python interpreter implemented in a restricted
statically-typed subset of the Python language called RPython. The interpreter
features a just-in-time compiler and supports multiple back-ends (C, CLI, JVM).</p>
<p>PyPy aims for maximum compatibility with the reference CPython implementation
while improving performance.</p>
<p>If you are looking to squeeze more performance out of your Python code, it&#8217;s
worth giving PyPy a try.</p>
<p>Currently PyPy supports Python 2.7.</p>
</div>
<div class="section" id="jython">
<h3>Jython<a class="headerlink" href="#jython" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://www.jython.org/">Jython</a> is a Python implementation that compiles
Python code to Java byte code that then executes on a JVM. It has the additional
advantage of being able to import and use any Java class the same as a Python
module.</p>
<p>If you need to interface with an existing Java codebase or have other reasons to
need to write Python code for the JVM, Jython is the best choice.</p>
<p>Currently Jython supports up to Python 2.5.</p>
</div>
<div class="section" id="ironpython">
<h3>IronPython<a class="headerlink" href="#ironpython" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://ironpython.net/">IronPython</a> is an implementation of Python for .NET
framework. It can use both Python and .NET framework libraries, and can also
expose Python code to other .NET languages.</p>
<p><a class="reference external" href="http://ironpython.net/tools/">Python Tools for Visual Studio</a> integrate
IronPython directly in to the Visual Studio development environment, making it
an ideal choice for Windows developers.</p>
<p>IronPython supports Python 2.7.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">About This Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Picking an Interpreter</a><ul>
<li><a class="reference internal" href="#x-vs-3-x">2.x vs 3.x</a><ul>
<li><a class="reference internal" href="#today">Today</a></li>
<li><a class="reference internal" href="#the-future">The Future</a></li>
</ul>
</li>
<li><a class="reference internal" href="#which-python-to-support">Which Python to Support?</a></li>
<li><a class="reference internal" href="#implementations">Implementations</a><ul>
<li><a class="reference internal" href="#cpython">CPython</a></li>
<li><a class="reference internal" href="#pypy">PyPy</a></li>
<li><a class="reference internal" href="#jython">Jython</a></li>
<li><a class="reference internal" href="#ironpython">IronPython</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="../intro/news.html" title="previous chapter">News</a></li>
<li>Next: <a href="installation.html" title="next chapter">Properly Installing Python</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/starting/which-python.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2011. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project.
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>