Skip to content

Commit 9712417

Browse files
committed
Add a new section on the "programs needed".
We've seen this many times before - people can get python, but don't know what to use to write it. So I've added a section on good code editors to use. They're specifically not IDEs. This also allowed reorganising the last section of the page to be more compact and easy to follow (less broken up by the dialogue boxes)
1 parent 9faef5d commit 9712417

1 file changed

Lines changed: 65 additions & 24 deletions

File tree

‎source/getting_started.rst‎

Lines changed: 65 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,67 @@
11
Getting started
22
***************
33

4-
If you haven't yet got python, the latest official installation packages can be found here:
4+
What you'll need
5+
================
6+
7+
A Python!
8+
---------
9+
10+
If you haven't yet got python, the latest official installation packages
11+
can be found here:
512

613
http://python.org/download/
714

815
Python 3 is preferable, being the newest version out!
916

1017
.. note::
1118

12-
On Windows, you'll want to add :program:`Python` to your path, so it can be found by other
13-
programs. To do this, navigate to your installation directory (:file:`C:\\Python33\\`),
14-
open the :file:`Tools`, then :file:`Scripts` folders, and run the :file:`win_add2path.py`
19+
On Windows, you'll want to add :program:`Python` to your path, so it
20+
can be found by other programs. To do this, navigate to your
21+
installation directory (:file:`C:\\Python33\\`), open the :file:`Tools`,
22+
then :file:`Scripts` folders, and run the :file:`win_add2path.py`
1523
file by double clicking on it.
1624

25+
And a Code Editor
26+
-----------------
27+
28+
A code editor helps with reading and writing programming code. There are
29+
many around, and it is one of the most personal choices a programmer can
30+
make - Like a tennis-player choosing their racket, or a chef choosing their
31+
favourite knife. To start off with, you'll just want a basic, easy-to-use one
32+
that doesn't get in your way, but is still effective at writing python code.
33+
Here are some suggestions for those:
34+
35+
- `Sublime Text`_: A great all around editor that's easy to use. It's Ctl+B
36+
shortcut lets you run the python file you're working on straight away. Runs
37+
on Windows, Mac and Linux.
38+
39+
- `Geany`_: A simple editor that doesn't aim to be too complicated. Available
40+
on Windows and Linux (you can probably find it in your package manager).
41+
42+
- `TextMate`_: One of the most famous code editors for Mac, it used to be a paid
43+
product but has since been open-sourced.
44+
45+
- `Gedit`_ and `Kate`_: if you run Linux using Gnome or KDE respectively, you
46+
might already have one of these two installed!
47+
48+
- `Komodo Edit`_: a sleak, free editor for Mac, Windows and Linux, based on the
49+
more powerful Komodo IDE.
50+
51+
.. _Sublime Text: http://www.sublimetext.com/
52+
.. _Geany: http://www.geany.org/
53+
.. _TextMate: http://macromates.com/
54+
.. _Gedit: https://projects.gnome.org/gedit/
55+
.. _Kate: http://kate-editor.org/
56+
.. _Komodo Edit: http://www.activestate.com/komodo-edit
57+
58+
If you'd like our recommendation, try out Sublime Text first.
59+
60+
.. tip::
61+
62+
Wordpad, TextEdit, Notepad, and Word are **not** suitable text
63+
editors.
64+
1765
What is Python, exactly?
1866
========================
1967

@@ -70,7 +118,7 @@ for it from the start menu. It should look like::
70118
Window's Command Prompt is not quite as powerful as its counterparts on Linux
71119
and OS X, so you might like to start the Python Interpreter (see just below)
72120
directly, or using the IDLE program that Python comes with. You can find these
73-
in the start menu.
121+
in the Start menu.
74122

75123
Using Python
76124
============
@@ -83,7 +131,7 @@ Just type :program:`python` at your console, hit :kbd:`<Enter>`, and you should
83131
enter Python's Interpreter.
84132

85133
To find out which version of python you're running,
86-
use :program:`python -V` to tell you.
134+
use ``python -V`` to tell you.
87135

88136
Interacting With Python
89137
-----------------------
@@ -103,16 +151,16 @@ After Python opens, it will show you some contextual information similar to this
103151

104152
You can now enter some python code. Try::
105153

106-
print("Hello world")
154+
print("Hello world")
107155

108156
Press :kbd:`<Enter>` and see what happens. After showing the results, Python
109157
will bring you back to the interactive prompt, where you could enter
110158
another command::
111159

112-
>>> print("Hello world")
113-
Hello world
114-
>>> (1 + 4) * 2
115-
10
160+
>>> print("Hello world")
161+
Hello world
162+
>>> (1 + 4) * 2
163+
10
116164

117165
An extremely useful command is ``help()``, which enters a help functionality
118166
to explore all the stuff python lets you do, right from the interpreter.
@@ -133,7 +181,7 @@ the interactive interpreter.
133181

134182
**Let's try that**. Create a file :file:`hello.py` in your current directory
135183
with your favorite text editor and write the print command from above. Now
136-
save-that file. On Linux or OS X, you can also run :kbd:`touch hello.py` to
184+
save that file. On Linux or OS X, you can also run :kbd:`touch hello.py` to
137185
create an empty file to edit. To run this file with python, it's pretty easy:
138186

139187
.. code-block:: bash
@@ -152,6 +200,8 @@ as before. But this time, after Python finished executing all commands from
152200
that file it exits back to the system command prompt, instead of going back
153201
to the interactive shell.
154202

203+
And now we are all set and can get started with turtle!
204+
155205
.. note::
156206

157207
Not getting "Hello world" but some crazy error about "can't open
@@ -163,7 +213,9 @@ to the interactive shell.
163213

164214
> cd Desktop\Python_Exercises
165215

166-
On Linux or OS X, you might want something like::
216+
On Linux or OS X, you might want something like:
217+
218+
.. code-block:: bash
167219
168220
$ cd Desktop/Python_Exercises
169221
@@ -174,20 +226,9 @@ to the interactive shell.
174226
directory your shell is currently running in use :command:`pwd`,
175227
which stands for "print working directory".
176228

177-
.. tip::
178-
179-
Wordpad, TextEdit, Notepad, and Word are **not** suitable text
180-
editors. If you are unsure whether you already have a usable
181-
editor, you might want to download and install `Sublime Text
182-
<http://www.sublimetext.com/>`_. Code editors like this
183-
can also help you with formatting, running and debugging your code.
184-
185-
And now we are all set and can get started with turtle!
186-
187229
.. warning::
188230

189231
When playing around with turtle, avoid naming your file :file:`turtle.py`
190232
--- rather use more appropriate names such as :file:`square.py` or
191233
:file:`rectangle.py`. Otherwise, whenever you refer to ``turtle``, Python
192234
will pick up *your* file instead of the standard turtle.
193-

0 commit comments

Comments
 (0)