@@ -81,14 +81,14 @@ by entering a few expressions of your choice and seeing the results:
81
81
82
82
Many people use the interactive mode as a convenient yet highly programmable
83
83
calculator. When you want to end your interactive Python session,
84
- call the `` exit() ` ` function or hold the :kbd: `Ctrl ` key down
84
+ call the :func: ` exit ` function or hold the :kbd: `Ctrl ` key down
85
85
while you enter a :kbd: `Z `, then hit the ":kbd: `Enter `" key to get
86
86
back to your Windows command prompt.
87
87
88
88
You may also find that you have a Start-menu entry such as :menuselection: `Start
89
- --> Programs --> Python 3.6 --> Python (command line) ` that results in you
89
+ --> Programs --> Python 3.x --> Python (command line) ` that results in you
90
90
seeing the ``>>> `` prompt in a new window. If so, the window will disappear
91
- after you call the `` exit() ` ` function or enter the :kbd: `Ctrl - Z `
91
+ after you call the :func: ` exit ` function or enter the :kbd: `Ctrl - Z `
92
92
character; Windows is running a single "python"
93
93
command in the window, and closes it when you terminate the interpreter.
94
94
@@ -101,37 +101,12 @@ similar to::
101
101
102
102
C:\Users\YourName>
103
103
104
- or::
104
+ So now you'll ask the ``py `` command to give your script to Python by
105
+ typing ``py `` followed by your script path::
105
106
106
- Bad command or filename
107
107
108
- then you need to make sure that your computer knows where to find the Python
109
- interpreter. To do this you will have to modify a setting called PATH, which is
110
- a list of directories where Windows will look for programs.
111
-
112
- You should arrange for Python's installation directory to be added to the PATH
113
- of every command window as it starts. If you installed Python fairly recently
114
- then the command ::
115
-
116
- dir C:\py*
117
-
118
- will probably tell you where it is installed; the usual location is something
119
- like ``C:\Python33 ``. Otherwise you will be reduced to a search of your whole
120
- disk ... use :menuselection: `Tools --> Find ` or hit the :guilabel: `Search `
121
- button and look for "python.exe". Supposing you discover that Python is
122
- installed in the ``C:\Python33 `` directory (the default at the time of writing),
123
- you should make sure that entering the command ::
124
-
125
- c:\Python33\python
126
-
127
- starts up the interpreter as above (and don't forget you'll need a ":kbd: `Ctrl - Z `" and
128
- an ":kbd: `Enter `" to get out of it). Once you have verified the directory, you can
129
- add it to the system path to make it easier to start Python by just running
130
- the ``python `` command. This is currently an option in the installer as of
131
- CPython 3.3.
132
-
133
- More information about environment variables can be found on the
134
- :ref: `Using Python on Windows <setting-envvars >` page.
108
+ C:\Users\YourName> py Desktop\hello.py
109
+ hello
135
110
136
111
How do I make Python scripts executable?
137
112
----------------------------------------
0 commit comments