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

Side by Side Diff: Doc/faq/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
« no previous file with comments | « no previous file | Doc/using/windows.rst » ('j') | Doc/using/windows.rst » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :tocdepth: 2 1 :tocdepth: 2
2 2
3 .. _windows-faq: 3 .. _windows-faq:
4 4
5 ===================== 5 =====================
6 Python on Windows FAQ 6 Python on Windows FAQ
7 ===================== 7 =====================
8 8
9 .. only:: html 9 .. only:: html
10 10
11 .. contents:: 11 .. contents::
12 12
13 .. XXX need review for Python 3. 13 .. XXX need review for Python 3.
14 XXX need review for Windows Vista/Seven? 14 XXX need review for Windows Vista/Seven?
Zach Ware 2014/03/13 15:11:23 If you've confirmed that things are right for Pyth
kathweaver 2014/03/18 02:27:06 I left the comment since I just review for 7/8 I'
15 15
16 .. _running-windows:
16 17
17 How do I run a Python program under Windows? 18 How do I run a Python program under Windows?
18 -------------------------------------------- 19 --------------------------------------------
19 20
20 This is not necessarily a straightforward question. If you are already familiar 21 This is not necessarily a straightforward question. If you are already familiar
21 with running programs from the Windows command line then everything will seem 22 with running programs from the Windows command line then everything will seem
22 obvious; otherwise, you might need a little more guidance. 23 obvious; otherwise, you might need a little more guidance.
23 24
24 .. sidebar:: |Python Development on XP|_ 25 .. sidebar:: |Python Development on XP|_
25 :subtitle: `Python Development on XP`_ 26 :subtitle: `Python Development on XP`_
26 27
27 This series of screencasts aims to get you up and running with Python on 28 This series of screencasts aims to get you up and running with Python on
28 Windows XP. The knowledge is distilled into 1.5 hours and will get you up 29 Windows XP. The knowledge is distilled into 1.5 hours and will get you up
29 and running with the right Python distribution, coding in your choice of IDE, 30 and running with the right Python distribution, coding in your choice of IDE,
30 and debugging and writing solid code with unit-tests. 31 and debugging and writing solid code with unit-tests.
31 32
32 .. |Python Development on XP| image:: python-video-icon.png 33 .. |Python Development on XP| image:: python-video-icon.png
33 .. _`Python Development on XP`: 34 .. _`Python Development on XP`:
34 http://www.showmedo.com/videos/series?name=pythonOzsvaldPyNewbieSeries 35 http://www.showmedo.com/videos/series?name=pythonOzsvaldPyNewbieSeries
35 36
36 Unless you use some sort of integrated development environment, you will end up 37 Unless you use some sort of integrated development environment, you will end up
37 *typing* Windows commands into what is variously referred to as a "DOS window" 38 *typing* Windows commands into what is variously referred to as a "DOS window"
38 or "Command prompt window". Usually you can create such a window from your 39 or "Command prompt window". Usually you can create such a window from your
39 Start menu; under Windows 7 the menu selection is :menuselection:`Start --> 40 Start menu; under Windows 7 the menu selection is :menuselection:`Start -->
40 Programs --> Accessories --> Command Prompt`. You should be able to recognize 41 Programs --> Accessories --> Command Prompt`; under Windows 8 right click the
42 Windows Icon or type Command Prompt at the Start Menu. You should be able to re cognize
Zach Ware 2014/03/13 15:11:23 A general comment that applies throughout the docs
kathweaver 2014/03/18 02:27:06 Done.
41 when you have started such a window because you will see a Windows "command 43 when you have started such a window because you will see a Windows "command
42 prompt", which usually looks like this:: 44 prompt", which usually looks like this::
43 45
44 C:\> 46 C:\>
45 47
46 The letter may be different, and there might be other things after it, so you 48 The letter may be different, and there might be other things after it, so you
47 might just as easily see something like:: 49 might just as easily see something like::
48 50
49 D:\YourName\Projects\Python> 51 D:\YourName\Projects\Python>
50 52
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 .. _`Adding Python to DOS Path`: 109 .. _`Adding Python to DOS Path`:
108 http://showmedo.com/videos/video?name=960000&fromSeriesID=96 110 http://showmedo.com/videos/video?name=960000&fromSeriesID=96
109 111
110 112
111 or:: 113 or::
112 114
113 Bad command or filename 115 Bad command or filename
114 116
115 then you need to make sure that your computer knows where to find the Python 117 then you need to make sure that your computer knows where to find the Python
116 interpreter. To do this you will have to modify a setting called PATH, which is 118 interpreter. To do this you will have to modify a setting called PATH, which is
117 a list of directories where Windows will look for programs. 119 a list of directories where Windows will look for programs.
eric.araujo 2014/03/13 06:34:55 Minor: trailing whitespace here.
kathweaver 2014/03/18 02:27:06 Done.
118 120
119 You should arrange for Python's installation directory to be added to the PATH 121 You should arrange for Python's installation directory to be added to the PATH
120 of every command window as it starts. If you installed Python fairly recently 122 of every command window as it starts. If you installed Python fairly recently
121 then the command :: 123 then the command ::
122 124
123 dir C:\py* 125 dir C:\py*
124 126
125 will probably tell you where it is installed; the usual location is something 127 will probably tell you where it is installed; the usual location is something
126 like ``C:\Python33``. Otherwise you will be reduced to a search of your whole 128 like ``C:\Python33``. Otherwise you will be reduced to a search of your whole
127 disk ... use :menuselection:`Tools --> Find` or hit the :guilabel:`Search` 129 disk ... use :menuselection:`Tools --> Find` or hit the :guilabel:`Search`
128 button and look for "python.exe". Supposing you discover that Python is 130 button and look for "python.exe". Supposing you discover that Python is
129 installed in the ``C:\Python33`` directory (the default at the time of writing), 131 installed in the ``C:\Python33`` directory (the default at the time of writing),
130 you should make sure that entering the command :: 132 you should make sure that entering the command ::
131 133
132 c:\Python33\python 134 c:\Python33\python
133 135
134 starts up the interpreter as above (and don't forget you'll need a "CTRL-Z" and 136 starts up the interpreter as above (and don't forget you'll need a "CTRL-Z" and
135 an "Enter" to get out of it). Once you have verified the directory, you can 137 an "Enter" to get out of it). Once you have verified the directory, you can
136 add it to the system path to make it easier to start Python by just running 138 add it to the system path to make it easier to start Python by just running
137 the ``python`` command. This is currently an option in the installer as of 139 the ``python`` command. This is currently an option in the installer as of
138 CPython 3.3. 140 CPython 3.3.
139 141
140 More information about environment variables can be found on the 142 More information about environment variables and path can be found
141 :ref:`Using Python on Windows <setting-envvars>` page. 143 :ref:`below<setting-envvars>` .
eric.araujo 2014/03/13 06:34:55 Minor: please add a space before the <.
kathweaver 2014/03/18 02:27:06 Done.
142 144
143 How do I make Python scripts executable? 145 How do I make Python scripts executable?
144 ---------------------------------------- 146 ----------------------------------------
145 147
146 On Windows, the standard Python installer already associates the .py 148 On Windows, the standard Python installer already associates the .py
147 extension with a file type (Python.File) and gives that file type an open 149 extension with a file type (Python.File) and gives that file type an open
148 command that runs the interpreter (``D:\Program Files\Python\python.exe "%1" 150 command that runs the interpreter (``D:\Program Files\Python\python.exe "%1"
149 %*``). This is enough to make scripts executable from the command prompt as 151 %*``). This is enough to make scripts executable from the command prompt as
150 'foo.py'. If you'd rather be able to execute the script by simple typing 'foo' 152 'foo.py'. If you'd rather be able to execute the script by simple typing 'foo'
151 with no extension you need to add .py to the PATHEXT environment variable. 153 with no extension you need to add .py to the PATHEXT environment variable.
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 --------------------------------------------------------- 337 ---------------------------------------------------------
336 338
337 Sometimes, when you download the documentation package to a Windows machine 339 Sometimes, when you download the documentation package to a Windows machine
338 using a web browser, the file extension of the saved file ends up being .EXE. 340 using a web browser, the file extension of the saved file ends up being .EXE.
339 This is a mistake; the extension should be .TGZ. 341 This is a mistake; the extension should be .TGZ.
340 342
341 Simply rename the downloaded file to have the .TGZ extension, and WinZip will be 343 Simply rename the downloaded file to have the .TGZ extension, and WinZip will be
342 able to handle it. (If your copy of WinZip doesn't, get a newer one from 344 able to handle it. (If your copy of WinZip doesn't, get a newer one from
343 http://www.winzip.com.) 345 http://www.winzip.com.)
344 346
347 .. sectionauthor:: Kathleen Weaver <kathleen@kweaver.org>
348 .. moved from using windows
349
350 .. _setting-envvars:
351
352 How do I Change Enviroment Settings?
eric.araujo 2014/03/13 06:34:55 Typo: Environment
kathweaver 2014/03/18 02:27:06 Done.
353 ------------------------------------
354
355 To change environment variables in Windows 7 and 8, you must use the built-in di alog.
356
357 Windows has a built-in dialog for changing environment variables
eric.araujo 2014/03/13 06:34:55 This seems redundant with the sentence just above.
358
359 Windows XP: Right-click the icon for your machine
eric.araujo 2014/03/13 06:34:55 Indentation is like special markup in reStructured
kathweaver 2014/03/18 02:27:06 I am not sure I understand. I want to separate Wi
360 (usually located on your Desktop and called "My Computer") and choose
361 :menuselection:`Properties` there. Then, open the :guilabel:`Advanced` tab
362 and click the :guilabel:`Environment Variables` button.
363
364 In short, your path is:
365
366 :menuselection:`My Computer
367 --> Properties
368 --> Advanced
369 --> Environment Variables`
370
371 Windows 7: Right-click the Windows Icon, choose :menuselection:`Contol Panel` .
372 Then click :guilabel:`System` and click the :guilabel:`Advanced system settin gs`
373 and click the :guilabel:`Environment Variables` button.
374
375 In short, your path is:
376
377 :menuselection:`Control Panel
378 --> System
379 --> Advanced system settings
380 --> Environment Variables`
381
382 Windows 8: Right-click the Windows Icon, choose
383 :menuselection:`System` and click the :guilabel:`Advanced system settings` and click
384 the :guilabel:`Environment Variables` button. (Windows 8 skips the con trol panel)
385
386 In short, your path is:
387
388 :menuselection:`System
389 --> Advanced system settings
390 --> Environment Variables`
391
392 In this dialog, you can add or modify User and System variables. To change
393 System variables, you need non-restricted access to your machine
394 (i.e. Administrator rights).
395
396 Another way of adding variables to your environment in versions prior to Windows 7 and 8
397 is using the :command:`set`
398 command::
399
400 set PYTHONPATH=%PYTHONPATH%;C:\My_python_lib
401
402 To make this setting permanent, you could add the corresponding command line to
403 your :file:`autoexec.bat`. :program:`msconfig` is a graphical interface to this
404 file.
405
406 Viewing environment variables in all Windows versions 8.1 and below can also be
407 done more straight-forward: The command prompt will expand strings wrapped into
408 percent signs automatically::
409
410 echo %PATH%
411
412 Consult :command:`set /?` for details on this behaviour.
413
414 .. seealso::
415
416 http://support.microsoft.com/kb/100843
417 Environment variables in Windows NT
418
419 http://support.microsoft.com/kb/310519
420 How To Manage Environment Variables in Windows XP
421
422 http://www.chem.gla.ac.uk/~louis/software/faq/q1.html
423 Setting Environment variables, Louis J. Farrugia
424
OLDNEW
« no previous file with comments | « no previous file | Doc/using/windows.rst » ('j') | Doc/using/windows.rst » ('J')

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