You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/getting_started.rst
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,35 +4,36 @@ Getting started
4
4
Starting Python
5
5
===============
6
6
7
-
After installing Python on your system successfully, you can start the interactive python prompt by typing "python" in the command and press <enter>. It will show you some context information about python similar to this::
7
+
After installing Python on your system successfully, you can start the interactive Python prompt by typing ``python`` in the command and press <enter>. It will show you some context information about Python similar to this::
8
8
9
9
Python 2.7.2 (default, Feb 1 2012, 00:28:57)
10
10
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
11
11
Type "help", "copyright", "credits" or "license" for more information.
12
12
>>>
13
13
14
14
15
-
.. note:: On windows the installer is not always setting up the "path" correctly. If that is the case on your system, you probably didn't see this message before but have to follow the steps described on the `python docs <http://docs.python.org/using/windows.html#excursus-setting-environment-variables>`_ and **restart your command line**.
15
+
.. note:: On windows the installer is not always setting up the "path" correctly. If that is the case on your system, you probably didn't see this message before but have to follow the steps described on the `Python docs <http://docs.python.org/using/windows.html#excursus-setting-environment-variables>`_ and **restart your command line**.
16
16
17
-
Those three ">>>" in the last line indicate that you are now in the interactive shell of python. Type for example::
17
+
Those three ">>>" in the last line indicate that you are now in the interactive shell of Python. Type for example::
18
18
19
19
print("Hello world")
20
20
21
-
press <enter> and see what happens. You will now see the phrase "Hello world" appear and then python will bring you back to the interactive input, where you could enter another command now::
21
+
press <enter> and see what happens. You will now see the phrase "Hello world" appear and then Python will bring you back to the interactive input, where you could enter another command now::
22
22
23
23
>>> print("Hello world")
24
24
Hello world
25
25
>>>
26
26
27
27
28
-
Running python files
28
+
Running Python files
29
29
====================
30
30
31
-
But you don't want to type everything into the Python shell everytime but have a file with commands for python to execute instead. In order to do that you can just pass a file name to the python command in your shell and it will execute that file. Let's try that. Just open the file "hello.py" in this directory in your favourite text editor and paste the print command from above. Now save that file, go back the command line and type::
31
+
But you don't want to type everything into the Python shell everytime but have a file with commands for Python to execute instead. In order to do that you can just pass a file name to the Python command in your shell and it will execute that file. Let's try that. Just open the file "hello.py" in this directory in your favourite text editor and paste the print command from above. Now save that file, go back the command line and type::
32
+
would be much berrbut have a file with commands for Python to execute instead. In order to do that you can just pass a file name to the Python command in your shell and it will execute that file. Let's try that. Just open the file "hello.py" in this directory in your favourite text editor and paste the print command from above. Now save that file, go back the command line and type::
32
33
33
-
python hello.py
34
+
Python hello.py
34
35
35
-
When pressing <enter> now, the file is executed and you see the print as before. But this time, after python executed all commands from that file, it exited instead of going back to the interactive shell. In some opearting systems (and depending on your setup) you might also be able to just double click on the hello.py file to execute it
36
+
When pressing <enter> now, the file is executed and you see the print as before. But this time, after Python executed all commands from that file, it exited instead of going back to the interactive shell. In some opearting systems (and depending on your setup) you might also be able to just double click on the hello.py file to execute it
36
37
37
38
.. note:: Wordpad, TextEdit, Notepad and Word are **not** suited text editors. If you are unsure whether you already have a usable editor, you might want to download and install `Sublime Text2 <http://www.sublimetext.com/>`_. Sophisticated editors like this also take care of identation and help you run and debug your code.
0 commit comments