diff -r fbdaca8bf3f5 Doc/faq/windows.rst --- a/Doc/faq/windows.rst Wed Mar 12 15:09:00 2014 -0500 +++ b/Doc/faq/windows.rst Mon Mar 17 20:20:38 2014 -0500 @@ -11,15 +11,19 @@ .. contents:: .. XXX need review for Python 3. - XXX need review for Windows Vista/Seven? +.. _running-windows: How do I run a Python program under Windows? -------------------------------------------- -This is not necessarily a straightforward question. If you are already familiar -with running programs from the Windows command line then everything will seem -obvious; otherwise, you might need a little more guidance. +The situation has been made somewhat simpler since Python 3.3, which +introduced the launcher for windows. Use is discussed +at :ref:`launcher`. + +If you are already familiar with running programs from the Windows command +line then everything will seem obvious; otherwise, you might need a little +more guidance. .. sidebar:: |Python Development on XP|_ :subtitle: `Python Development on XP`_ @@ -33,12 +37,14 @@ .. _`Python Development on XP`: http://www.showmedo.com/videos/series?name=pythonOzsvaldPyNewbieSeries -Unless you use some sort of integrated development environment, you will end up -*typing* Windows commands into what is variously referred to as a "DOS window" -or "Command prompt window". Usually you can create such a window from your -Start menu; under Windows 7 the menu selection is :menuselection:`Start --> -Programs --> Accessories --> Command Prompt`. You should be able to recognize -when you have started such a window because you will see a Windows "command +Unless you use some sort of integrated development environment, you will end up +*typing* Windows commands into what is variously referred to as a "DOS window" +or "Command prompt window". Usually you can create such a window from your +Start menu; under Windows 7 the menu selection is :menuselection:`Start --> +Programs --> Accessories --> Command Prompt`; under Windows 8 right click the +Windows Icon or type Command Prompt at the Start Menu. Make sure to pick the +Command Prompt followed by (Admin) You should be able to recognize +when you have started such a window because you will see a Windows "command prompt", which usually looks like this:: C:\> @@ -131,14 +137,15 @@ c:\Python33\python -starts up the interpreter as above (and don't forget you'll need a "CTRL-Z" and -an "Enter" to get out of it). Once you have verified the directory, you can +starts up the interpreter as above. +Once you have verified the directory, you can add it to the system path to make it easier to start Python by just running the ``python`` command. This is currently an option in the installer as of CPython 3.3. -More information about environment variables can be found on the -:ref:`Using Python on Windows ` page. +If you need further assistance with Environment Settings see: +http://www.computerhope.com/issues/ch000549.htm and note that both Windows +7 and Windows 8 use similar methods to accomplish the task. How do I make Python scripts executable? ---------------------------------------- @@ -340,5 +347,4 @@ Simply rename the downloaded file to have the .TGZ extension, and WinZip will be able to handle it. (If your copy of WinZip doesn't, get a newer one from -http://www.winzip.com.) - +http://www.winzip.com.) \ No newline at end of file diff -r fbdaca8bf3f5 Doc/using/windows.rst --- a/Doc/using/windows.rst Wed Mar 12 15:09:00 2014 -0500 +++ b/Doc/using/windows.rst Mon Mar 17 20:20:38 2014 -0500 @@ -20,17 +20,26 @@ has compiled Windows installers (MSI packages) with every `release `_ for many years. +After running the installer, the following programs will be available in the +Start Menu under the title Python x.x where x.x is the version number. + + * IDLE (Python GUI) - a simple IDE for Python, written in Python using + Tkinter + * Python (command line) - Python command line interpreter + * Python Manuals - Python documentation + * Module Docs -Module Documentation + * Uninstall Python - which will uninstall these programs. + +Multiple versions of Python can be installed next to each other without +interfering with each other. + With ongoing development of Python, some platforms that used to be supported earlier are no longer supported (due to the lack of users or developers). Check :pep:`11` for details on all unsupported platforms. * `Windows CE `_ is still supported. -* The `Cygwin `_ installer offers to install the `Python - interpreter `_ as well; it is located under - "Interpreters." (cf. `Cygwin package source - `_, `Maintainer releases - `_) +* The `Cygwin `_ installer offers to install the Python + interpreter as well; it is located under "Interpreters." See `Python for Windows `_ for detailed information about platforms with pre-compiled installers. @@ -47,12 +56,6 @@ by Mark Pilgrim, 2004, ISBN 1-59059-356-1 - `For Windows users `_ - in "Installing Python" - in "`A Byte of Python `_" - by Swaroop C H, 2003 - - Alternative bundles =================== @@ -69,66 +72,22 @@ Notice that these packages are likely to install *older* versions of Python. +Running Python +============== +The following shortcuts are created during installation and can be used to run Python: -Configuring Python -================== +* Python (command line) +* IDLE (Python GUI) +* Select Python through File Explorer +* Find the Python directory and double click python -In order to run Python flawlessly, you might have to change certain environment -settings in Windows. +While these tools are useful to get started, it is still recommended to run +Python through the launcher for windows. Use is discussed +at :ref:`launcher`. - -.. _setting-envvars: - -Excursus: Setting environment variables ---------------------------------------- - -Windows has a built-in dialog for changing environment variables (following -guide applies to XP classical view): Right-click the icon for your machine -(usually located on your Desktop and called "My Computer") and choose -:menuselection:`Properties` there. Then, open the :guilabel:`Advanced` tab -and click the :guilabel:`Environment Variables` button. - -In short, your path is: - - :menuselection:`My Computer - --> Properties - --> Advanced - --> Environment Variables` - -In this dialog, you can add or modify User and System variables. To change -System variables, you need non-restricted access to your machine -(i.e. Administrator rights). - -Another way of adding variables to your environment is using the :command:`set` -command:: - - set PYTHONPATH=%PYTHONPATH%;C:\My_python_lib - -To make this setting permanent, you could add the corresponding command line to -your :file:`autoexec.bat`. :program:`msconfig` is a graphical interface to this -file. - -Viewing environment variables can also be done more straight-forward: The -command prompt will expand strings wrapped into percent signs automatically:: - - echo %PATH% - -Consult :command:`set /?` for details on this behaviour. - -.. seealso:: - - http://support.microsoft.com/kb/100843 - Environment variables in Windows NT - - http://support.microsoft.com/kb/310519 - How To Manage Environment Variables in Windows XP - - http://www.chem.gla.ac.uk/~louis/software/faq/q1.html - Setting Environment variables, Louis J. Farrugia - - -.. _windows-path-mod: +Python scripts are associated with Python and will run when clicked, but the +window will close immediately, usually faster than the user can read. Finding the Python executable ----------------------------- @@ -137,7 +96,8 @@ Besides using the automatically created start menu entry for the Python interpreter, you might want to start Python in the command prompt. As of -Python 3.3, the installer has an option to set that up for you. +Python 3.3, the installer has an option to set that up for you. However, +in Windows 8, you must use the Command Prompt (Admin). At the "Customize Python 3.3" screen, an option called "Add python.exe to search path" can be enabled to have the installer place @@ -148,14 +108,8 @@ If you don't enable this option at install time, you can always re-run the installer to choose it. -The alternative is manually modifying the :envvar:`%PATH%` using the -directions in :ref:`setting-envvars`. You need to set your :envvar:`%PATH%` -environment variable to include the directory of your Python distribution, -delimited by a semicolon from other entries. An example variable could look -like this (assuming the first two entries are Windows' default):: - - C:\WINDOWS\system32;C:\WINDOWS;C:\Python33 - +The alternative is manually modifying the :envvar:`%PATH%`. See the +FAQ:ref:`_running-windows:`. Finding modules --------------- @@ -209,7 +163,6 @@ very strange installation setup) you get a path with some default, but relative, paths. - Executing scripts ----------------- @@ -231,7 +184,7 @@ setting this through the usual facilities, for example (might require administrative rights): -#. Launch a command prompt. +#. Launch a command prompt [Windows 8 - Launch Command Prompt (Admin)] #. Associate the correct file group with ``.py`` scripts:: assoc .py=Python.File @@ -585,6 +538,15 @@ by Trent Apted et al, 2007 + +Using Visual Studio +=================== + +There is `Python Tools for Visual Studio `_ an addon published +by Microsoft for many versions of Visual Studio except the Express editions. + + + Other resources =============== @@ -599,6 +561,4 @@ by Amanda Birmingham, 2004 :pep:`397` - Python launcher for Windows - The proposal for the launcher to be included in the Python distribution. - - + The proposal for the launcher to be included in the Python distribution. \ No newline at end of file