Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The last Python you install that registers itself in the environment is the default (I can't remember the exact wording in the installer, but it is the first option). There are a number of settings so to make sure they are all registered consistently just reinstall the version you want to be the default.</p> <p>If you want to install another version but don't want it as the default just disable the registration option during installation.</p> <p><strong>Edit (May 19, 2012)</strong></p> <p>Starting with Python 3.3, the Python installer installs <a href="http://docs.python.org/3/using/windows.html?highlight=python%20launcher#python-launcher-for-windows" rel="noreferrer">Python Launcher for Windows</a>. This program (<code>py.exe</code>) is associated with the Python file extensions and looks for a "shebang" comment to specify the python version to run. This allows many versions of Python to co-exist and allows Python scripts to explicitly specify which version to use, if desired. If it is not specified, the default is to use the latest Python 2.X version for the current architecture (x86 or x64). This default can be customized through a <code>py.ini</code> file or <code>PY_PYTHON</code> environment variable. See the <a href="http://docs.python.org/3/using/windows.html?highlight=python%20launcher#python-launcher-for-windows" rel="noreferrer">docs</a> for more details.</p> <p>Just make sure the Python 3.3 is the last Python installed that registered itself with Windows. If other versions of Python are installed later be sure <strong>not</strong> to register them with the environment, so the launcher will remain the default.</p> <p>Here's how to check if the launcher is registered correctly from the console:</p> <pre><code>C:\&gt;assoc .py .py=Python.File C:\&gt;ftype Python.File Python.File="C:\Windows\py.exe" "%1" %* </code></pre> <p>Above, <code>.py</code> files are associated with the <code>Python.File</code> type. The command line for <code>Python.File</code> is the Python Launcher, which is installed in the Windows directory since it is always in the PATH.</p> <p>For the association to work, run scripts from the command line with <code>script.py</code>, not "python script.py", otherwise <code>python</code> will be run instead of <code>py</code>. <code>py.exe</code> can also be run with switches to force a Python version:</p> <pre><code>py -3 script.py # force latest Python 3.X version to be used. </code></pre> <p>Additionally, add <code>.py;.pyw;.pyc;.pyo</code> to the <code>PATHEXT</code> environment variable and then the command line can just be <code>script</code> with no extension.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload