Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(206139)

Side by Side Diff: Doc/using/windows.rst

Issue 20265: Bring Doc/using/windows up to date
Patch Set: Created 5 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« Doc/faq/windows.rst ('K') | « Doc/faq/windows.rst ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 .. highlightlang:: none 1 .. highlightlang:: none
2 2
3 .. _using-on-windows: 3 .. _using-on-windows:
4 4
5 ************************* 5 *************************
6 Using Python on Windows 6 Using Python on Windows
7 ************************* 7 *************************
8 8
9 .. sectionauthor:: Robert Lehmann <lehmannro@gmail.com> 9 .. sectionauthor:: Robert Lehmann <lehmannro@gmail.com>
10 10
11 This document aims to give an overview of Windows-specific behaviour you should 11 This document aims to give an overview of Windows-specific behaviour you should
12 know about when using Python on Microsoft Windows. 12 know about when using Python on Microsoft Windows.
13 13
14 14
15 Installing Python 15 Installing Python
16 ================= 16 =================
17 17
18 Unlike most Unix systems and services, Windows does not require Python natively 18 Unlike most Unix systems and services, Windows does not require Python natively
19 and thus does not pre-install a version of Python. However, the CPython team 19 and thus does not pre-install a version of Python. However, the CPython team
20 has compiled Windows installers (MSI packages) with every `release 20 has compiled Windows installers (MSI packages) with every `release
21 <http://www.python.org/download/releases/>`_ for many years. 21 <http://www.python.org/download/releases/>`_ for many years.
22
23
Zach Ware 2014/03/15 05:13:58 A couple too many blank lines.
kathweaver 2014/03/18 02:27:06 Done.
24
25 After running the installer, the following programs will be available in the
26 Start Menu under the title Python x.x where x.x is the version number.
Zach Ware 2014/03/15 05:13:58 I think there is markup for something that expands
kathweaver 2014/03/18 02:27:06 Yes, but we tell them that they can run multiple v
27
28 * IDLE (Python GUI) - suitable for creating and running Python Scripts along with being a command line interpreter
Zach Ware 2014/03/15 05:13:58 I think IDLE can be better described as "a simple
kathweaver 2014/03/18 02:27:06 Done.
kathweaver 2014/03/18 02:27:06 Done.
29 * Python (command line) - Python command line interpreter
30 * Python Manuals - Python documentation
31 * Uninstall Python - which will uninstall these programs.
32
Zach Ware 2014/03/15 05:13:58 The 'Module Docs' entry is missing.
kathweaver 2014/03/18 02:27:06 Done.
33 All versions can be installed and will run independently. The Windows command
Zach Ware 2014/03/15 05:13:58 I would reword this to something like "Multiple ve
34 prompt typically runs the last installed version of Python.
Zach Ware 2014/03/15 05:13:58 This isn't really true: Command Prompt runs whiche
kathweaver 2014/03/18 02:27:06 Done.
22 35
23 With ongoing development of Python, some platforms that used to be supported 36 With ongoing development of Python, some platforms that used to be supported
24 earlier are no longer supported (due to the lack of users or developers). 37 earlier are no longer supported (due to the lack of users or developers).
25 Check :pep:`11` for details on all unsupported platforms. 38 Check :pep:`11` for details on all unsupported platforms.
26 39
27 * `Windows CE <http://pythonce.sourceforge.net/>`_ is still supported. 40 * `Windows CE <http://pythonce.sourceforge.net/>`_ is still supported.
28 * The `Cygwin <http://cygwin.com/>`_ installer offers to install the `Python 41 * The `Cygwin <http://cygwin.com/>`_ installer offers to install the Python
29 interpreter <http://cygwin.com/packages/python>`_ as well; it is located under 42 interpreter as well; it is located under "Interpreters."
30 "Interpreters." (cf. `Cygwin package source
31 <ftp://ftp.uni-erlangen.de/pub/pc/gnuwin32/cygwin/mirrors/cygnus/
32 release/python>`_, `Maintainer releases
33 <http://www.tishler.net/jason/software/python/>`_)
34 43
35 See `Python for Windows <http://www.python.org/download/windows/>`_ 44 See `Python for Windows <http://www.python.org/download/windows/>`_
36 for detailed information about platforms with pre-compiled installers. 45 for detailed information about platforms with pre-compiled installers.
37 46
38 .. seealso:: 47 .. seealso::
39 48
40 `Python on XP <http://www.richarddooling.com/index.php/2006/03/14/python-on-x p-7-minutes-to-hello-world/>`_ 49 `Python on XP <http://www.richarddooling.com/index.php/2006/03/14/python-on-x p-7-minutes-to-hello-world/>`_
41 "7 Minutes to "Hello World!"" 50 "7 Minutes to "Hello World!""
42 by Richard Dooling, 2006 51 by Richard Dooling, 2006
43 52
44 `Installing on Windows <http://diveintopython.net/installing_python/windows.h tml>`_ 53 `Installing on Windows <http://diveintopython.net/installing_python/windows.h tml>`_
45 in "`Dive into Python: Python from novice to pro 54 in "`Dive into Python: Python from novice to pro
46 <http://diveintopython.net/index.html>`_" 55 <http://diveintopython.net/index.html>`_"
47 by Mark Pilgrim, 2004, 56 by Mark Pilgrim, 2004,
48 ISBN 1-59059-356-1 57 ISBN 1-59059-356-1
49 58
50 `For Windows users <http://swaroopch.com/text/Byte_of_Python:Installing_Pytho n#For_Windows_users>`_ 59 For Windows users
51 in "Installing Python" 60 in "`Installing Python" <http://swaroopch.com/notes/python_en-installation />`_"
Zach Ware 2014/03/15 05:13:58 This needs some work; the section in question no l
kathweaver 2014/03/18 02:27:06 I deleted it then. On 2014/03/15 05:13:58, Zach W
52 in "`A Byte of Python <http://www.byteofpython.info>`_"
53 by Swaroop C H, 2003 61 by Swaroop C H, 2003
54 62
55 63
56 Alternative bundles 64 Alternative bundles
57 =================== 65 ===================
58 66
59 Besides the standard CPython distribution, there are modified packages including 67 Besides the standard CPython distribution, there are modified packages including
60 additional functionality. The following is a list of popular versions and their 68 additional functionality. The following is a list of popular versions and their
61 key features: 69 key features:
62 70
63 `ActivePython <http://www.activestate.com/activepython/>`_ 71 `ActivePython <http://www.activestate.com/activepython/>`_
64 Installer with multi-platform compatibility, documentation, PyWin32 72 Installer with multi-platform compatibility, documentation, PyWin32
65 73
66 `Enthought Python Distribution <http://www.enthought.com/products/epd.php>`_ 74 `Enthought Python Distribution <http://www.enthought.com/products/epd.php>`_
67 Popular modules (such as PyWin32) with their respective documentation, tool 75 Popular modules (such as PyWin32) with their respective documentation, tool
68 suite for building extensible Python applications 76 suite for building extensible Python applications
69 77
70 Notice that these packages are likely to install *older* versions of Python. 78 Notice that these packages are likely to install *older* versions of Python.
71 79
80 Running Python
81 ==============
82
83 The following shortcuts are created during installation and can be used to run P ython:
84
85 * Python (command line)
86 * IDLE (Python GUI)
87 * Select Python through File Explorer
88 * Find the Python directory and double click python
89
90 While these tools are useful to get started, it is still recommended to run
91 Python through the Windows Command line and set environment variables.
Zach Ware 2014/03/15 05:13:58 "the Windows Command line" -> "Command Prompt (cmd
92 Directions for setting environments are located at :ref:`setting-envvars`.
93 Detailed directions for running Python are at :ref:`running-windows`.
72 94
73 95
74 Configuring Python 96 Python scripts are associated with Python and will run when opened, but the
75 ================== 97 window will close immediately, usually faster than the user can read.
Zach Ware 2014/03/15 05:13:58 Both of these lines and several others have traili
kathweaver 2014/03/18 02:27:06 Done.
76
77 In order to run Python flawlessly, you might have to change certain environment
78 settings in Windows.
79
80
81 .. _setting-envvars:
82
83 Excursus: Setting environment variables
84 ---------------------------------------
85
86 Windows has a built-in dialog for changing environment variables (following
87 guide applies to XP classical view): Right-click the icon for your machine
88 (usually located on your Desktop and called "My Computer") and choose
89 :menuselection:`Properties` there. Then, open the :guilabel:`Advanced` tab
90 and click the :guilabel:`Environment Variables` button.
91
92 In short, your path is:
93
94 :menuselection:`My Computer
95 --> Properties
96 --> Advanced
97 --> Environment Variables`
98
99 In this dialog, you can add or modify User and System variables. To change
100 System variables, you need non-restricted access to your machine
101 (i.e. Administrator rights).
102
103 Another way of adding variables to your environment is using the :command:`set`
104 command::
105
106 set PYTHONPATH=%PYTHONPATH%;C:\My_python_lib
107
108 To make this setting permanent, you could add the corresponding command line to
109 your :file:`autoexec.bat`. :program:`msconfig` is a graphical interface to this
110 file.
111
112 Viewing environment variables can also be done more straight-forward: The
113 command prompt will expand strings wrapped into percent signs automatically::
114
115 echo %PATH%
116
117 Consult :command:`set /?` for details on this behaviour.
118
119 .. seealso::
120
121 http://support.microsoft.com/kb/100843
122 Environment variables in Windows NT
123
124 http://support.microsoft.com/kb/310519
125 How To Manage Environment Variables in Windows XP
126
127 http://www.chem.gla.ac.uk/~louis/software/faq/q1.html
128 Setting Environment variables, Louis J. Farrugia
129
130
131 .. _windows-path-mod:
132 98
133 Finding the Python executable 99 Finding the Python executable
134 ----------------------------- 100 -----------------------------
135 101
136 .. versionchanged:: 3.3 102 .. versionchanged:: 3.3
137 103
138 Besides using the automatically created start menu entry for the Python 104 Besides using the automatically created start menu entry for the Python
139 interpreter, you might want to start Python in the command prompt. As of 105 interpreter, you might want to start Python in the command prompt. As of
140 Python 3.3, the installer has an option to set that up for you. 106 Python 3.3, the installer has an option to set that up for you.
141 107
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 opens a terminal, which stays open even if the program uses a GUI. If you do 190 opens a terminal, which stays open even if the program uses a GUI. If you do
225 not want this to happen, use the extension ``.pyw`` which will cause the script 191 not want this to happen, use the extension ``.pyw`` which will cause the script
226 to be executed by :program:`pythonw.exe` by default (both executables are 192 to be executed by :program:`pythonw.exe` by default (both executables are
227 located in the top-level of your Python installation directory). This 193 located in the top-level of your Python installation directory). This
228 suppresses the terminal window on startup. 194 suppresses the terminal window on startup.
229 195
230 You can also make all ``.py`` scripts execute with :program:`pythonw.exe`, 196 You can also make all ``.py`` scripts execute with :program:`pythonw.exe`,
231 setting this through the usual facilities, for example (might require 197 setting this through the usual facilities, for example (might require
232 administrative rights): 198 administrative rights):
233 199
234 #. Launch a command prompt. 200 #. Launch a command prompt [Windows 8 - Launch Command Prompt (Admin)]
Zach Ware 2014/03/15 05:13:58 I still think any change here should be just movin
235 #. Associate the correct file group with ``.py`` scripts:: 201 #. Associate the correct file group with ``.py`` scripts::
236 202
237 assoc .py=Python.File 203 assoc .py=Python.File
238 204
239 #. Redirect all Python files to the new executable:: 205 #. Redirect all Python files to the new executable::
240 206
241 ftype Python.File=C:\Path\to\pythonw.exe "%1" %* 207 ftype Python.File=C:\Path\to\pythonw.exe "%1" %*
242 208
243 209
244 .. _launcher: 210 .. _launcher:
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 by Mark Hammond and Andy Robinson, O'Reilly Media, 2000, 561 by Mark Hammond and Andy Robinson, O'Reilly Media, 2000,
596 ISBN 1-56592-621-8 562 ISBN 1-56592-621-8
597 563
598 `A Python for Windows Tutorial <http://www.imladris.com/Scripts/PythonForWind ows.html>`_ 564 `A Python for Windows Tutorial <http://www.imladris.com/Scripts/PythonForWind ows.html>`_
599 by Amanda Birmingham, 2004 565 by Amanda Birmingham, 2004
600 566
601 :pep:`397` - Python launcher for Windows 567 :pep:`397` - Python launcher for Windows
602 The proposal for the launcher to be included in the Python distribution. 568 The proposal for the launcher to be included in the Python distribution.
603 569
604 570
OLDNEW
« Doc/faq/windows.rst ('K') | « Doc/faq/windows.rst ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+