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 Thu Mar 13 21:44:02 2014 -0500 @@ -11,12 +11,17 @@ .. contents:: .. XXX need review for Python 3. - XXX need review for Windows Vista/Seven? + XXX need review for Windows Vista/Seven? Reviewed Windows 7/8 by kw +.. _running-windows: How do I run a Python program under Windows? -------------------------------------------- +Starting with Python 3.3, there is launcher for windows. Use is +discussed at :ref:`launcher`. +Some users may find that method more efficient than the below method. + 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. @@ -33,13 +38,15 @@ .. _`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 -prompt", which usually looks like this:: +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. 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:\> @@ -137,8 +144,8 @@ 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. +More information about environment variables and path can be found +:ref:`below ` . How do I make Python scripts executable? ---------------------------------------- @@ -342,3 +349,84 @@ able to handle it. (If your copy of WinZip doesn't, get a newer one from http://www.winzip.com.) +.. sectionauthor:: Kathleen Weaver +.. moved from using windows + +.. _setting-envvars: + +How do I Change Environment Settings? +------------------------------------- + +To change environment variables in Windows 7 and 8, you must use the +built-in dialog. There is an alternative method that works for prior +versions which is described later. + +Using the built-in dialog for changing environment variables: + + Windows XP: 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` + + Windows 7: Right-click the Windows Icon, choose :menuselection:`Contol Panel`. + Then click :guilabel:`System` and click the :guilabel:`Advanced system settings` + and click the :guilabel:`Environment Variables` button. + + In short, your path is: + + :menuselection:`Control Panel + --> System + --> Advanced system settings + --> Environment Variables` + + Windows 8: Right-click the Windows Icon, choose + :menuselection:`System` and click the :guilabel:`Advanced system settings` + and click the :guilabel:`Environment Variables` button. + (Windows 8 skips the control panel) + + In short, your path is: + + :menuselection:`System + --> Advanced system settings + --> 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 in versions prior to +Windows 7 and 8 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 in all Windows versions 8.1 and below 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 + 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 Thu Mar 13 21:44:02 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) - suitable for creating and running Python Scripts along with being a command line interpreter + * Python (command line) - Python command line interpreter + * Python Manuals - Python documentation + * Uninstall Python - which will uninstall these programs. + +All versions can be installed and will run independently. The Windows command +prompt typically runs the last installed version of Python. + 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,9 +56,8 @@ by Mark Pilgrim, 2004, ISBN 1-59059-356-1 - `For Windows users `_ - in "Installing Python" - in "`A Byte of Python `_" + For Windows users + in "`Installing Python" `_" by Swaroop C H, 2003 @@ -69,66 +77,24 @@ 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 Windows Command line and set environment variables. +Directions for setting environments are located at :ref:`setting-envvars`. +Detailed directions for running Python are at :ref:`running-windows`. -.. _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 opened, but the +window will close immediately, usually faster than the user can read. Finding the Python executable ----------------------------- @@ -231,7 +197,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