Skip to content

Commit a61b4a2

Browse files
committed
Merge pull request realpython#458 from george2/grammar-and-typos
More grammar and typo fixes.
2 parents 9d664e6 + 1329ee2 commit a61b4a2

File tree

16 files changed

+240
-203
lines changed

16 files changed

+240
-203
lines changed

docs/dev/env.rst

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,40 @@ Your Development Environment
55
Text Editors
66
::::::::::::
77

8-
Just about anything which can edit plain text will work for writing Python code,
8+
Just about anything that can edit plain text will work for writing Python code,
99
however, using a more powerful editor may make your life a bit easier.
1010

1111

12-
VIM
12+
Vim
1313
---
1414

1515
Vim is a text editor which uses keyboard shortcuts for editing instead of menus
16-
or icons. There exist a couple of plugins and settings for the VIM editor to
16+
or icons. There are a couple of plugins and settings for the Vim editor to
1717
aid Python development. If you only develop in Python, a good start is to set
1818
the default settings for indentation and line-wrapping to values compliant with
1919
:pep:`8`. In your home directory, open a file called :file:`.vimrc` and add the
2020
following lines::
2121

2222
set textwidth=79 " lines longer than 79 columns will be broken
2323
set shiftwidth=4 " operation >> indents 4 columns; << unindents 4 columns
24-
set tabstop=4 " an hard TAB displays as 4 columns
24+
set tabstop=4 " a hard TAB displays as 4 columns
2525
set expandtab " insert spaces when hitting TABs
2626
set softtabstop=4 " insert/delete 4 spaces when hitting a TAB/BACKSPACE
2727
set shiftround " round indent to multiple of 'shiftwidth'
2828
set autoindent " align the new line indent with the previous line
2929

3030
With these settings, newlines are inserted after 79 characters and indentation
31-
is set to 4 spaces per tab. If you also use VIM for other languages, there is a
32-
handy plugin at indent_, which handles indentation settings for Python source
31+
is set to 4 spaces per tab. If you also use Vim for other languages, there is a
32+
handy plugin called indent_, which handles indentation settings for Python source
3333
files.
3434

35-
There is also a handy syntax plugin at syntax_ featuring some improvements over
36-
the syntax file included in VIM 6.1.
35+
There is also a handy syntax plugin called syntax_ featuring some improvements over
36+
the syntax file included in Vim 6.1.
3737

3838
These plugins supply you with a basic environment for developing in Python.
3939
To get the most out of Vim, you should continually check your code for syntax
4040
errors and PEP8 compliance. Luckily PEP8_ and Pyflakes_ will do this for you.
41-
If your VIM is compiled with :option:`+python` you can also utilize some very handy
41+
If your Vim is compiled with :option:`+python` you can also utilize some very handy
4242
plugins to do these checks from within the editor.
4343

4444
For PEP8 checking, install the vim-pep8_ plugin, and for pyflakes you can
@@ -51,7 +51,7 @@ order to do this, add the following lines to your :file:`.vimrc`::
5151
autocmd BufWritePost *.py call Pyflakes()
5252
autocmd BufWritePost *.py call Pep8()
5353

54-
If you are already using syntastic_ you can enable it to run Pyflakes on write
54+
If you are already using syntastic_, you can set it to run Pyflakes on write
5555
and show errors and warnings in the quickfix window. An example configuration
5656
to do that which also shows status and warning messages in the statusbar would be::
5757

@@ -61,24 +61,26 @@ to do that which also shows status and warning messages in the statusbar would b
6161
let g:syntastic_auto_loc_list=1
6262
let g:syntastic_loc_list_height=5
6363

64+
6465
Python-mode
6566
^^^^^^^^^^^
6667

67-
Python-mode_ is a complex solution in VIM for working with Python code.
68+
Python-mode_ is a complex solution for working with Python code in Vim.
6869
It has:
6970

7071
- Asynchronous Python code checking (``pylint``, ``pyflakes``, ``pep8``, ``mccabe``) in any combination
7172
- Code refactoring and autocompletion with Rope
7273
- Fast Python folding
7374
- Virtualenv support
74-
- Search by Python documentation and run Python code
75+
- Search through Python documentation and run Python code
7576
- Auto PEP8_ error fixes
7677

7778
And more.
7879

7980
SuperTab
8081
^^^^^^^^
81-
SuperTab_ is a small VIM plugin that makes code completion more convenient by
82+
83+
SuperTab_ is a small Vim plugin that makes code completion more convenient by
8284
using ``<Tab>`` key or any other customized keys.
8385

8486
.. _indent: http://www.vim.org/scripts/script.php?script_id=974
@@ -94,9 +96,9 @@ using ``<Tab>`` key or any other customized keys.
9496
Emacs
9597
-----
9698

97-
Emacs is a powerful text editor. It's fully programmable (lisp), but
98-
it can be some work to wire up correctly. A good start if you're
99-
already an Emacs user is `Python Programming in Emacs`_ at EmacsWiki.
99+
Emacs is another powerful text editor. It is fully programmable (lisp), but
100+
it can be some work to wire up correctly. A good start if you're already an
101+
Emacs user is `Python Programming in Emacs`_ at EmacsWiki.
100102

101103
1. Emacs itself comes with a Python mode.
102104
2. Python ships with an alternate version:
@@ -155,18 +157,18 @@ Spyder
155157

156158
`Spyder <http://code.google.com/p/spyderlib/>`_ is an IDE specifically geared
157159
toward working with scientific Python libraries (namely `Scipy <http://www.scipy.org/>`_).
158-
It includes integration with pyflakes_, `pylint <http://www.logilab.org/857>`_,
160+
It includes integration with pyflakes_, `pylint <http://www.logilab.org/857>`_
159161
and `rope <http://rope.sourceforge.net/>`_.
160162

161163
Spyder is open-source (free), offers code completion, syntax highlighting,
162-
class and function browser, and object inspection.
164+
a class and function browser, and object inspection.
163165

164166

165167
WingIDE
166168
-------
167169

168170
`WingIDE <http://wingware.com/>`_ is a Python specific IDE. It runs on Linux,
169-
Windows, and Mac (as an X11 application, which frustrates some Mac users).
171+
Windows and Mac (as an X11 application, which frustrates some Mac users).
170172

171173
WingIDE offers code completion, syntax highlighting, source browser, graphical
172174
debugger and support for version control systems.
@@ -196,8 +198,9 @@ It solves the "Project X depends on version 1.x but, Project Y needs 4.x"
196198
dilemma, and keeps your global site-packages directory clean and manageable.
197199

198200
`virtualenv <http://www.virtualenv.org/en/latest/index.html>`_ creates
199-
a folder which contains all the necessary executables to contain the
200-
packages that a Python project would need. An example workflow is given.
201+
a folder which contains all the necessary executables to use the
202+
packages that a Python project would need. An example workflow is given
203+
below.
201204

202205
Install virtualenv:
203206

@@ -230,7 +233,7 @@ The name of the current virtual environment will now appear on the left
230233
of the prompt (e.g. ``(venv)Your-Computer:your_project UserName$``) to
231234
let you know that it's active. From now on, any package that you install
232235
using ``pip`` will be placed in the ``venv`` folder, isolated from the global
233-
Python installation.
236+
Python installation.
234237

235238
Install packages as usual:
236239

@@ -259,9 +262,9 @@ the current state of the environment packages. To do this, run
259262
260263
This will create a :file:`requirements.txt` file, which contains a simple
261264
list of all the packages in the current environment, and their respective
262-
versions. Later, when a different developer (or you, if you need to re-
263-
create the environment) can install the same packages, with the same
264-
versions by running
265+
versions. Later it will be easier for a different developer (or you, if you
266+
need to re-create the environment) to install the same packages using the
267+
same versions:
265268

266269
.. code-block:: console
267270
@@ -291,8 +294,8 @@ Put this into your :file:`~/.bash_profile` (Linux/Mac) file:
291294
$ export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
292295
293296
This will prevent your virtualenvs from relying on your (global) site packages
294-
directory, so that they are completely separate..
295-
[note: This is the default behavior for ``virtualenv`` 1.7 and later]
297+
directory, so that they are completely separate.
298+
[Note: This is the default behavior for ``virtualenv`` 1.7 and later]
296299

297300
Other Tools
298301
:::::::::::

docs/intro/duction.rst

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ include:
1111

1212
Python's philosophy focuses on readability, from code blocks
1313
delineated with significant whitespace to intuitive keywords in
14-
place of inscrutable punctuation
14+
place of inscrutable punctuation.
1515

1616
* **extensive standard libraries and third party modules for virtually
1717
any task**
1818

1919
Python is sometimes described with the words "batteries included"
20-
for its extensive
20+
because of its extensive
2121
`standard library <http://docs.python.org/library/>`_, which includes
2222
modules for regular expressions, file IO, fraction handling,
2323
object serialization, and much more.
@@ -77,13 +77,11 @@ For the Community
7777

7878
All contributions to the Guide are welcome, from Pythonistas of all levels.
7979
If you think there's a gap in what the Guide covers, fork the Guide on
80-
GitHub and submit a pull request.
80+
GitHub and submit a pull request.
8181

82-
Contributions are welcome from everyone, whether they're an old hand or a
83-
first-time Pythonista, and the authors to the Guide will gladly help if you
84-
have any questions about the appropriateness, completeness, or accuracy of
82+
Contributions are welcome from everyone, whether they're an old hand or a
83+
first-time Pythonista, and the authors to the Guide will gladly help if you
84+
have any questions about the appropriateness, completeness, or accuracy of
8585
a contribution.
8686

8787
To get started working on The Hitchhiker's Guide, see the :doc:`/notes/contribute` page.
88-
89-

docs/intro/learning.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Beginner
77
The Python Tutorial
88
~~~~~~~~~~~~~~~~~~~~
99

10-
This is the official tutorial, it covers all the basics, and offers a tour of the
11-
language and the standard library, recommended for those who need a quickstart
10+
This is the official tutorial. It covers all the basics, and offers a tour of the
11+
language and the standard library. Recommended for those who need a quickstart
1212
guide to the language.
1313

1414
`The Python Tutorial <http://docs.python.org/tutorial/index.html>`_
@@ -189,6 +189,7 @@ Miscellaneous topics
189189

190190
Problem Solving with Algorithms and Data Structures
191191
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192+
192193
Problem Solving with Algorithms and Data Structures covers a range of data structures and
193194
algorithms. All concepts are illustrated with Python code along with interactive samples
194195
that can be run directly in the browser.
@@ -198,8 +199,9 @@ that can be run directly in the browser.
198199

199200
Programming Collective Intelligence
200201
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
202+
201203
Programming Collective Intelligence introduces a wide array of basic machine learning and
202-
data mining methods. The exposition is not very mathematically formal, but rather focuses
204+
data mining methods. The exposition is not very mathematically formal, but rather focuses
203205
on explaining the underlying intuition and shows how to implement the algorithms in Python.
204206

205207
`Programming Collective Intelligence <http://shop.oreilly.com/product/9780596529321.do>`_
@@ -223,7 +225,7 @@ This is Python's reference manual, it covers the syntax and the core semantics o
223225
language.
224226

225227
`The Python Language Reference <http://docs.python.org/reference/index.html>`_
226-
228+
227229
Python Pocket Reference
228230
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
229231

@@ -237,13 +239,12 @@ Writing Idiomatic Python
237239
~~~~~~~~~~~~~~~~~~~~~~~~
238240

239241
"Writing Idiomatic Python", written by Jeff Knupp, contains the most common and
240-
important Python idioms in a format that maximizes identification and understanding.
241-
Each idiom is presented as a recommendation to write some commonly used piece of code.
242-
It is followed by an explanation of why the idiom is important. It also contains two
243-
code samples: the "Harmful" way to write it and the "Idiomatic" way
242+
important Python idioms in a format that maximizes identification and understanding.
243+
Each idiom is presented as a recommendation of a way to write some commonly
244+
used piece of code, followed by an explanation of why the idiom is important.
245+
It also contains two code samples for each idiom: the "Harmful" way to write it
246+
and the "Idiomatic" way.
244247

245248
`For Python 2.7.3+ <http://www.amazon.com/Writing-Idiomatic-Python-2-7-3-Knupp/dp/1482372177/>`_
246249

247250
`For Python 3.3+ <http://www.amazon.com/Writing-Idiomatic-Python-Jeff-Knupp-ebook/dp/B00B5VXMRG/>`_
248-
249-

docs/scenarios/admin.rst

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,12 @@ State files can be written using YAML, the Jinja2 template system or pure Python
126126

127127
Psutil
128128
------
129-
`Psutil <https://code.google.com/p/psutil/>`_ is an interface to different system information (e.g. CPU, memory, disks, network, users and processes).
130129

131-
Here is an example to be aware of some server overload. In case of some failed test (net, CPU) it send an email.
130+
`Psutil <https://code.google.com/p/psutil/>`_ is an interface to different
131+
system information (e.g. CPU, memory, disks, network, users and processes).
132+
133+
Here is an example to be aware of some server overload. If any of the
134+
tests (net, CPU) fail, it will send an email.
132135

133136
.. code-block:: python
134137
@@ -162,7 +165,7 @@ Here is an example to be aware of some server overload. In case of some failed t
162165
if counter > 25:
163166
attack = 0
164167
counter = 0
165-
# Write a very important email if attack is higher then 4
168+
# Write a very important email if attack is higher than 4
166169
TO = "you@your_email.com"
167170
FROM = "webmaster@your_domain.com"
168171
SUBJECT = "Your domain is out of system resources!"
@@ -173,32 +176,38 @@ Here is an example to be aware of some server overload. In case of some failed t
173176
server.quit()
174177
175178
176-
A full terminal application like a widely extended top which is based on psutil and with the ability of a client-server
177-
monitoring is `glance <https://github.com/nicolargo/glances/>`_.
179+
A full terminal application like a widely extended top which is based on
180+
psutil and with the ability of a client-server monitoring is
181+
`glance <https://github.com/nicolargo/glances/>`_.
178182

179183
Ansible
180184
-------
181-
`Ansible <http://ansible.com/>`_ is a open source system automation tool. The biggest advantage over Puppet or Chef is it does not require an agent on the client machine. Playbooks are Ansible’s configuration, deployment, and orchestration language and are written in in yaml with jinja2 for templating.
185+
186+
`Ansible <http://ansible.com/>`_ is an open source system automation tool.
187+
The biggest advantage over Puppet or Chef is it does not require an agent on
188+
the client machine. Playbooks are Ansible’s configuration, deployment, and
189+
orchestration language and are written in in YAML with Jinja2 for templating.
182190

183191
Ansible supports Python versions 2.6 and 2.7 and can be installed via pip:
184192

185193
.. code-block:: console
186194
187195
$ pip install ansible
188196
189-
Ansible requires a inventory file that describes the hosts it has access to. Here is an example of a host and
190-
playbook that will ping all the hosts in the inventory file:
197+
Ansible requires an inventory file that describes the hosts to which it has
198+
access. Below is an example of a host and playbook that will ping all the
199+
hosts in the inventory file.
191200

192201
Here is an example inventory file:
193-
hosts.yml
202+
:file:`hosts.yml`
194203

195204
.. code-block:: yaml
196205
197206
[server_name]
198207
127.0.0.1
199208
200209
Here is an example playbook:
201-
ping.yml
210+
:file:`ping.yml`
202211

203212
.. code-block:: yaml
204213
@@ -207,17 +216,17 @@ ping.yml
207216
208217
tasks:
209218
- name: ping
210-
action: ping
219+
action: ping
211220
212221
To run the playbook:
213222

214223
.. code-block:: console
215224
216225
$ ansible-playbook ping.yml -i hosts.yml --ask-pass
217226
218-
That Ansible playbook will ping all of the servers in the hosts.yml file. You can also select groups of servers using Ansible. For more information about Ansible read the docs.
219-
220-
`Ansible Docs <http://docs.ansible.com/>`_
227+
The Ansible playbook will ping all of the servers in the :file:`hosts.yml` file.
228+
You can also select groups of servers using Ansible. For more information
229+
about Ansible, read the `Ansible Docs <http://docs.ansible.com/>`_.
221230

222231

223232
Chef

0 commit comments

Comments
 (0)