100% found this document useful (6 votes)
391 views

Python Projects For Kids 1st Edition Ingrassellino Download PDF

Projects

Uploaded by

safoyapharoe29
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (6 votes)
391 views

Python Projects For Kids 1st Edition Ingrassellino Download PDF

Projects

Uploaded by

safoyapharoe29
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

Download the full version of the textbook now at textbookfull.

com

Python Projects for Kids 1st Edition


Ingrassellino

https://textbookfull.com/product/python-projects-
for-kids-1st-edition-ingrassellino/

Explore and download more textbook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Python for kids a playful introduction to programming 1st


Edition Briggs

https://textbookfull.com/product/python-for-kids-a-playful-
introduction-to-programming-1st-edition-briggs/

textbookfull.com

Python Projects for Beginners: A Ten-Week Bootcamp


Approach to Python Programming Milliken

https://textbookfull.com/product/python-projects-for-beginners-a-ten-
week-bootcamp-approach-to-python-programming-milliken/

textbookfull.com

Gardening for Kids Learn Grow and Get Messy with Fun STEAM
Projects 1st Edition Stone

https://textbookfull.com/product/gardening-for-kids-learn-grow-and-
get-messy-with-fun-steam-projects-1st-edition-stone/

textbookfull.com

Cancer Genetics and Therapeutics Focus on Phytochemicals


Madhumita Roy

https://textbookfull.com/product/cancer-genetics-and-therapeutics-
focus-on-phytochemicals-madhumita-roy/

textbookfull.com
An Office Grinch Romance 1st Edition Sharon Cummin

https://textbookfull.com/product/an-office-grinch-romance-1st-edition-
sharon-cummin/

textbookfull.com

Sustainable Water Management New Perspectives Design and


Practices 1st Edition Ken’Ichi Nakagami

https://textbookfull.com/product/sustainable-water-management-new-
perspectives-design-and-practices-1st-edition-kenichi-nakagami/

textbookfull.com

Stewart Macaulay Selected Works David Campbell

https://textbookfull.com/product/stewart-macaulay-selected-works-
david-campbell/

textbookfull.com

Effective Police Supervision Study Guide Larry S. Miller

https://textbookfull.com/product/effective-police-supervision-study-
guide-larry-s-miller/

textbookfull.com

Think Like a Data Scientist: Tackle the Data Science


Process Step-by-Step 1st Edition Brian Godsey

https://textbookfull.com/product/think-like-a-data-scientist-tackle-
the-data-science-process-step-by-step-1st-edition-brian-godsey/

textbookfull.com
Biodiversity Conservation and Phylogenetic Systematics
Preserving our evolutionary heritage in an extinction
crisis 1st Edition Roseli Pellens
https://textbookfull.com/product/biodiversity-conservation-and-
phylogenetic-systematics-preserving-our-evolutionary-heritage-in-an-
extinction-crisis-1st-edition-roseli-pellens/
textbookfull.com
Python Projects for Kids

Unleash Python and take your small readers on an


adventurous ride through the world of programming

Jessica Ingrassellino

BIRMINGHAM - MUMBAI
Python Projects for Kids

Copyright © 2016 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: April 2016

Production reference: 1070416

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham B3 2PB, UK.

ISBN 978-1-78217-506-3
www.packtpub.com
Credits

Author Project Coordinator


Jessica Ingrassellino Nikhil Nair

Reviewer Proofreader
David Whale Safis Editing

Commissioning Editor Indexer


Veena Pagare Rekha Nair

Acquisition Editor Production Coordinator


Aaron Lazar Melwyn Dsa

Content Development Editor Cover Work


Sachin Karnani Melwyn Dsa

Technical Editor
Rupali R. Shrawane

Copy Editor
Sonia Cheema
About the Author

Jessica Ingrassellino is a multi-talented educator, business leader, and technologist.


She received her EdD from Teachers College, Columbia University for music education
with an emphasis on assessment.

Jessica is currently employed as the lead software engineer in testing at Bitly, New
York City. She transitioned from a teaching career of 10 years to a technology career
through a balance of freelance work and social media exposure. Jessica's current
work focuses on using Python to develop automated testing tools. She is an ASTQB
certified quality assurance engineer with experience in testing web, mobile, and
backend applications.

In addition to working at Bitly, Jessica remains committed to education and


has founded http://www.teachcode.org/, a nonprofit that teaches computer
programming skills to teachers and students in urban or underserved populations
through Python and 2D game programming. This new initiative will give teachers
the support they need through a standards-referenced curriculum, student-engaging
activities, and access to experts in the field of technology.

I would like to thank my students for allowing me to have such


fun teaching them Python and learning from their experiences as
new programmers. I would also like to thank Cathy Kross and
Alice McGowan for being willing to have me in their classes and
school and interrupting their daily lives with my code-teaching
experiments. Finally, I would like to thank my husband, Nick, for
believing in me and helping me through some major writer's block.
He never loses faith in me, and for that, I am eternally grateful.
About the Reviewer

David Whale is a software developer who lives in Essex, UK. He started coding
as a schoolboy aged 11, inspired by his school's science technician to build his own
computer from a kit. These early experiments lead to some of his code being used in
a saleable educational word game when he was only 13.

David has been developing software professionally ever since, mainly writing
embedded software that provides intelligence inside electronic products, including
automated machinery, electric cars, mobile phones, energy meters, and wireless
doorbells.

These days, David runs his own software consultancy called Thinking Binaries,
and he spends about half of his time helping customers design software for new
electronic products, many of which use Python. The rest of the time, he volunteers
for The Institution of Engineering and Technology, running training courses for
teachers, designing and running workshops and clubs for school children, running
workshops and talks at meet-up events all round the UK, and generally being busy
with his Raspberry Pi, BBC micro:bit, and Arduino.

David was the technical editor of Adventures in Raspberry Pi, John Wiley & Sons, the
coauthor of Adventures in Minecraft, and he is a regular reviewer and editor
of technical books for a number of book publishers.

I was really pleased to be asked to review this exciting new coding


book for children. Python is an excellent language for children to
learn from a young age, and Jessica has done a great job at helping
readers take their first few steps in coding with Python. I hope you
will be inspired by the code and ideas in this book and come up
with your own ideas to enhance and develop all of the programs
further—this is just the start of your exciting new creative journey
into coding with Python!
www.PacktPub.com

eBooks, discount offers, and more


Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.
com and as a print book customer, you are entitled to a discount on the eBook copy.
Get in touch with us at customercare@packtpub.com for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign
up for a range of free newsletters and receive exclusive discounts and offers on Packt
books and eBooks.

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital
book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser
Table of Contents
Preface vii
Chapter 1: Welcome! Let's Get Started 1
Python projects for you 1
What can you do with Python? 1
Why you should learn Python 2
The prerequisites of Python 2
Setting up your computer 3
For Mac and Ubuntu Linux users 3
Python 2.7 3
For Windows users 5
Write and run your first program in the command line 7
Make yourself a work folder 9
A quick task for you 10
Summary 11
Chapter 2: Variables, Functions, and Users 13
Variables 13
Naming variables – conventions to follow 14
What can variables remember? 15
Strings 15
Integers 16
Floating point numbers (floats) 17
Combining strings, integers, and floats 18
Functions 19
Built-in functions 19
Parts of a function 20
Users interacting with your program 22
Using the text editor and the command line 23

[i]
Table of Contents

Build your own function – name() 24


Set up your project file 24
Begin your project 25
Writing code 25
Running your program 27
Going the extra mile 27
A quick task for you 28
Summary 29
Chapter 3: Calculate This! 31
The calculator 31
Basic functions 32
Operations on two numbers 33
Convert data into numbers – int() and float() 34
Floating point to whole number conversion 34
Whole number to floating point conversion 35
Text strings fail in int() and float() 35
Creating our first calculator file 36
New functions – subtraction, multiplication, and division 37
Subtraction 37
Multiplication 38
Division 39
Finding a remainder – modulo 40
Running your program 41
A quick task for you 42
Summary 42
Chapter 4: Making Decisions – Python Control Flows 43
Is it equal, not equal, or something else? 44
Conditional statements – if, elif, else 45
Getting better input 46
if 46
elif 47
else 49
Loops 50
while 50
Global variables and the quit() function 50
Using the quit() function 51
Using the while loop to control the program 52
for 53
Bonus – count_to_ten() function 55
A quick task for you 56
Summary 57

[ ii ]
Table of Contents

Chapter 5: Loops and Logic 59


Higher or Lower 59
Game file set up 60
Importing libraries 61
Setting and initializing global variables 62
What is a Boolean? 62
Building the easy version 63
Compare numbers 64
play_again() 66
Start, stop, play again 67
start_game() 67
play_again() 68
Play testing 69
Building the hard version 71
Comparing numbers – the hard version 72
Play test the whole program! 74
A quick task for you 76
Summary 77
Chapter 6: Working with Data – Lists and Dictionaries 79
Lists 79
Parts of a list 80
Working with a list 81
Changing the list – adding and removing information 83
Adding items to the list 83
Removing items from the list 84
Lists and loops 84
Dictionaries 86
Key/value pairs in dictionaries 86
Changing the dictionary – adding and removing information 88
Adding items to the dictionary 88
Changing the value of an existing item 89
Removing items from the dictionary 90
List or dictionary 91
A quick task for you 92
Summary 93
Chapter 7: What's in Your Backpack? 95
Setting up our coding environment 95
Planning to program your game 96
Skills needed to make a program 97
Score, play again, or quit? 98

[ iii ]
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
Table of Contents

Getting and storing player information 98


Making a players list 98
Player profiles 99
Player profiles – how do they work? 101
Add players to profile 102
Adding items to the virtual backpack 103
Limiting items in a virtual backpack 103
Testing your code so far 104
A game loop 105
Bringing back the while loop 106
Comparing guesses with backpack items 107
Keeping score 108
Ending the game 108
Testing your game 109
A quick task for you 109
Summary 110
Chapter 8: pygame 113
What is pygame? 113
Installing pygame 115
Installing pygame – Windows 116
Installing pygame – Mac 118
Installing Xcode 118
Installing Homebrew 119
Installing pygame – Ubuntu Linux 120
Installing pygame – Raspberry Pi 120
pygame 120
Initializing pygame 121
Setting up the game screen – size 121
Setting up the game screen – color 122
Making stationary objects 123
while loop – viewing the screen 125
Making more shapes 125
Experimenting with shapes 127
More advanced shapes 127
Making moving objects 127
Moving objects with the keyboard 128
A quick task for you 128
Summary 129

[ iv ]
Table of Contents

Chapter 9: Tiny Tennis 131


Introduction to game programming principles 131
The game plan 132
Creating an outline of game parts 132
Section 1 – imports, globals, and drawings 133
Importing libraries 133
Introducing globals 134
Defining a color 134
Adjusting the screen size 135
Drawing the screen 136
Creating screen labels 136
Ball – the starting location 136
Ball – setting the speed and direction 137
Ball – setting the size 137
Paddles – starting location and size 138
Initializing the score 139
Testing section 1 140
Section 2 – moving the paddles 141
Pre-loop actions 141
Creating the while loop 142
Moving the paddles – keyboard events 143
Exiting the game – escape key 144
Paddle control – player 1 144
Paddle control – player 2 144
The increase and decrease value (-= and +=) 145
Testing section 2 145
Section 3 – moving the ball 146
Moving the ball – updating the location 146
Collision detection 146
Collision of the ball with the top and the bottom of the screen 146
Collision of the paddle with the top and the bottom of screen 147
Collision of the ball with the paddles 148
Testing – section 3 149
Section 4 – draw screen and track the score 150
The render screen – show what's happened 151
Displaying player scores 152
Ending the program 152
Play Tiny Tennis! 153
Summary 154

[v]
Table of Contents

Chapter 10: Keep Coding! 155


What we learned and your next steps 155
Classes and objects – very important next steps! 156
More fun with games 157
Adding music to games 157
Adding graphics to games 157
Remake or design games 158
Other games 158
PB-Ball 158
Snake 159
Other uses of Python 159
SciPy 160
iPython 160
MatPlotLib 161
Raspberry Pi 161
Coding challenges 162
Summary 163
Appendix: Quick Task Answers 165
Index 169

[ vi ]
Preface
As you can guess from the title, this book is designed to teach the basic concepts of
Python to kids. This book uses several mini projects so that kids can learn how to
solve problems using Python.

Python has grown to become a very popular language for programming web apps,
analyzing data, and teaching people how to write code. Python is known for being a
simple language to use because it is read much like natural languages, yet it is able
to do data analysis very quickly, making it a great language to create websites that
handle a lot of data. Another nice thing about Python that makes it fun to use is that
people have been working on game libraries, such as pygame, so that people can
create graphics programs with Python. The use of simple graphics to make short
games is a fun way to learn programming constructs and is especially good for
visual learners.

What this book covers


Chapter 1, Welcome! Let's Get Started, discusses Python and setting up a Python
development environment on Windows, Mac, and Linux operating systems.

Chapter 2, Variables, Functions, and Users, covers Python data types and functions,
as well as how to program Python to get information from the user, store that
information, and use it later.

Chapter 3, Calculate This!, uses Python to make a calculator that has multiple
mathematical functions. We also learn about working in our file structure and the
proper way to save code files.

Chapter 4, Making Decisions – Python Control Flows, covers the use of if, elif, and
else, as well as the use of for and while loops, in order to help create programs
that make decisions based on user actions.

[ vii ]
Preface

Chapter 5, Loops and Logic, builds upon what we have learned in the previous chapters
and allows us to build a number guessing game. We will build easy and difficult
versions of the game.

Chapter 6, Working with Data – Lists and Dictionaries, explains how to use lists
and dictionaries to store data. The differences between lists and dictionaries are
explained, and we spend time building small lists and dictionaries as well.

Chapter 7, What's in Your Backpack?, allows us to use functions, loops, logic, lists and
dictionaries to build a different kind of guessing game. We will also learn about
nesting dictionaries and lists.

Chapter 8, pygame, talks about a popular graphical library that is used in Python
to make small games. We will learn the fundamental aspects of this library and
experiment with some code.

Chapter 9, Tiny Tennis, this game is a clone of a popular game. We will re-create the
game using all of the skills that we have learned throughout the book. This is the
major project of the book.

Chapter 10, Keep Coding!, shows you all the opportunities that will arise once you read
this book.

Appendix, Quick Task Answers, has the answers to all the quick task questions within
the chapters.

What you need for this book


This book can be used with Windows 10, Mac OS X, or Ubuntu Linux operating
systems. Other versions of these operating systems may work; however, this book
has been written specifically to address these systems. Additionally, you will need
the Internet to download some tools, such as recommended text editors, for your
operating system. All recommended downloads are open source.

Who this book is for


This book is for kids who are ready to move from graphically-based programming
environments, such as Scratch, and into text-based environments. Kids who are
ready to create their own projects will engage with this book, especially those who
have played games. No prior programming experience is needed to complete the
projects in this book; this book is for kids aged 10 years and above, who are ready to
learn about Python programming.

[ viii ]
Preface

Conventions
In this book, you will find a number of text styles that distinguish between different
kinds of information. Here are some examples of these styles and an explanation of
their meaning.

Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows:
"Why don't you try giving the computer the name variable with your name and then
the height variable with your height?"

A block of code is set as follows:


def name():
first_name = input('What is your first name?')
print('So nice to meet you, ' + first_name)

name()

Any command-line input or output is written as follows:


python
>>>print("Hello, world!")

Warnings or important notes appear in a box like this.

Tips and tricks appear like this.

Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or disliked. Reader feedback is important for us as it helps
us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail feedback@packtpub.com, and mention


the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide at www.packtpub.com/authors.

[ ix ]
Preface

Customer support
Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.

Downloading the example code


You can download the example code files for this book from your account at
http://www.packtpub.com. If you purchased this book elsewhere, you can visit
http://www.packtpub.com/support and register to have the files e-mailed directly
to you.

You can download the code files by following these steps:

1. Log in or register to our website using your e-mail address and password.
2. Hover the mouse pointer on the SUPPORT tab at the top.
3. Click on Code Downloads & Errata.
4. Enter the name of the book in the Search box.
5. Select the book for which you're looking to download the code files.
6. Choose from the drop-down menu where you purchased this book from.
7. Click on Code Download.

You can also download the code files by clicking on the Code Files button on the
book's webpage at the Packt Publishing website. This page can be accessed by entering
the book's name in the Search box. Please note that you need to be logged in to your
Packt account.

Once the file is downloaded, please make sure that you unzip or extract the folder
using the latest version of:

• WinRAR / 7-Zip for Windows


• Zipeg / iZip / UnRarX for Mac
• 7-Zip / PeaZip for Linux

Downloading the color images of this book


We also provide you with a PDF file that has color images of the screenshots/
diagrams used in this book. The color images will help you better understand the
changes in the output. You can download this file from http://www.packtpub.com/
sites/default/files/downloads/PythonProjectsforKids_ColorImages.pdf.

[x]
Preface

Errata
Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you find a mistake in one of our books—maybe a mistake in the text or
the code—we would be grateful if you could report this to us. By doing so, you can
save other readers from frustration and help us improve subsequent versions of this
book. If you find any errata, please report them by visiting http://www.packtpub.
com/submit-errata, selecting your book, clicking on the Errata Submission Form
link, and entering the details of your errata. Once your errata are verified, your
submission will be accepted and the errata will be uploaded to our website or added
to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/


content/support and enter the name of the book in the search field. The required
information will appear under the Errata section.

Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all
media. At Packt, we take the protection of our copyright and licenses very seriously.
If you come across any illegal copies of our works in any form on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.

Please contact us at copyright@packtpub.com with a link to the suspected


pirated material.

We appreciate your help in protecting our authors and our ability to bring you
valuable content.

Questions
If you have a problem with any aspect of this book, you can contact us at
questions@packtpub.com, and we will do our best to address the problem.

[ xi ]
Welcome! Let's Get Started
If you've picked up this book, then you are taking your first step toward building
amazing projects using code. Some of you might want to make games, while others
might want to learn more about how all of your favorite websites and apps actually
work. If you follow the exercises in this book, you'll be able to do the following:

• Create fun games to play with your family and friends


• Learn about the inner workings of your apps
• Learn how to take charge of your computer

Python projects for you


In this book, you will learn Python code. Specifically, you will learn how to design
a computer program from the very beginning. It doesn't matter if you have never
coded before because each exercise in this book is designed to get you ready to
code. If you have coded before, you will find that this book has some really helpful
exercises that can help make your code even better. Additionally, there are some
more advanced projects toward the end of the book, which you should definitely
take a look at!

What can you do with Python?


If you take a look at the Web and search for Python jobs, you will find that many of
the highest paying jobs are in Python. Why?

Python is a very flexible and powerful language in the following ways:

• It can be used in order to go through millions of lines of data


• Python can search for information on a website without having to go to the
website itself
• It is even used to host and design websites
[1]
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
Welcome! Let's Get Started

So, what will it take to learn Python? If you have never programmed, you will
probably want to follow each lesson in order so that you can build the skills you
need to make a game or another kind of computer program. The final project in
this book will be a game. If you have some other programming experience, such as
making modifications to your computer games, using programs such as Scratch or
Logo or trying some of the free programming classes on the Internet, then you might
decide to skim this book first to see what you already know. It is still recommended
that you follow the contents of this book in the order they are presented, as each
project builds on the projects that were explained in the previous chapter.

Why you should learn Python


Python teaches all of the basics of an object-oriented programming language, and it
is still very powerful. In fact, many Internet companies, most notably Mozilla Firefox
and Google, use Python in part or all of their products! Python has also been used to
build Django, a free framework to make websites.

It has also been used to build many small video games by people learning about
it as well as more advanced programmers. Finally, Python can be used to quickly
read and analyze millions of lines of data very quickly! By learning Python, you will
be prepared to build a variety of interesting projects, and you will gain the skills
necessary to learn other programming languages if you choose to do so.

The prerequisites of Python


Before you get started, you need the following basic materials:

• A computer that can run Windows 7 or higher, Mac OS X 10.6 or higher,


or Ubuntu 12.4 or higher. You may also use a Raspberry Pi as it comes
preinstalled with Python, pygame, and the other software needed to
complete the projects in this book.
• An Internet connection is necessary as some of the software you need to
install on your computer might not be installed already. For example,
Windows operating systems do not come with Python preinstalled, so
an Internet connection will be needed; pygame is also not preinstalled on
Windows, Mac, or Linux systems.
• Along with an Internet connection, you will also need a web browser, such as
Firefox, Safari, Chrome, or Internet Explorer, which will allow you to visit the
Python documentation pages.

[2]
Chapter 1

All of the code samples in this book are available for download on
the Packt Publishing website.

Setting up your computer


There are many different computer operating systems, but the most common
operating systems are Macintosh (Mac), Windows, and Linux. You should follow
the installation steps that go with your operating system. There are some subtle but
important differences between the systems.

For the projects in this book, we will be using Python 2.7. While there are higher
versions than this (3.x), these versions do not work dependably with pygame on
Windows, Mac, or Ubuntu Linux as yet. However, this book will be written to
use conventions that work in both versions of Python so that projects are easily
completed on Raspberry Pi (which uses Python 3.x that's been specially configured
with pygame) with just a few modifications. These modifications will be duly noted.

For Mac and Ubuntu Linux users


Mac and Linux systems share enough similarities that people who use either Mac
or Linux can follow the same set of instructions. These instructions will make note
of any differences between Mac and Ubuntu Linux.

Python 2.7
At the time of writing, Mac OS X El Capitan comes with Python 2.7 preinstalled,
so nothing extra needs to be done at this point.

Ubuntu Linux 15.10 has Python 2.7.10 installed by default, so users of this latest
(as of writing this) version of Linux also need to do nothing extra at this point.

Terminal – the command line and the Python shell


Mac and Ubuntu Linux users have Python by default, but finding Python is tricky if
you don't know where to look. There is a program called Terminal on both Mac and
Linux operating systems. This program allows you to exercise a lot of control over
your computer in these ways:

• On a Mac, go to Finder | Applications | Utilities and click on Terminal.


The terminal application will open up, and you should see a small, white
window on your screen.

[3]
Welcome! Let's Get Started

• Ubuntu users can search for terminal on their desktops, and the program
will show up in their Start menu. When you click on the terminal, you will
see a small, black window on your screen.
• The terminal also functions as a Python shell when a command is given to
run Python. We will learn about this later.

Text editor
A text editor is a helpful tool for writing and editing Python programs. The terminal
is a nice place to test snippets of Python code, but when we want to edit and save the
code in order to use it over again, we will need a text editor. Although both Mac
and Linux systems come with a text editor, there are some very nice, free editors
that have good features. jEdit is one of these editors.

For Mac and Linux, go to http://www.jedit.org/ and download


jEdit. Follow the installation instructions.

To successfully complete all of the exercises in this book, you will often need to keep
both the terminal and text editor open at the same time on your screen.

[4]
Chapter 1

This is what the text editor application, jEdit, looks like in Mac and Linux:

For Windows users


Windows users, this setup might require help from your parents. Since Python is
not installed by default on Windows, some system adjustments need to be made
to successfully run Python on your computer. If you are feeling uncertain about
performing these system changes yourself, make sure to ask for help:

1. First, you will need to download version 2.7.11 of Python.

Use the official Python website for the latest releases for Windows
at https://www.python.org/downloads/release/
python-2711/.
With Windows, you need to figure out if you are running 32-bit or
64-bit so that you can download the correct version of Python. To
help you to determine which one is correct, visit
http://windows.microsoft.com/en-gb/windows/32-bit-
and-64-bit-windows#1TC=windows-7.
Download x86only if your computer is running 32-bit Windows.
Most users will download the x86-64 version of Python.

[5]
Welcome! Let's Get Started

2. Choose the executable installer, and you will see the download progress.
3. When the download is complete, you will see a prompt to run Python.
Click on Run.
4. An install prompt will come up, and when it does, look at the bottom of the
window and click on the box next to Add Python 2.x to Path. Then, select
Install Now.
5. Follow the installation instructions. Each step may take a few minutes. Once
the installation is done, you will have an icon for Python 2.7.11, which you
can find by searching for Python in the Windows search bar. This will open a
special Python shell from where you can run and test the Python code.

Command prompt
In Windows 10, you will see a terminal called the command prompt. The command
prompt is significantly different in Windows than it is on Mac or Linux.

To find the command prompt in Windows 10, perform these steps:

1. Go to the search bar at the bottom of the screen and search for cmd
or command.
2. When you do, you will see the command prompt desktop app appear.
Click on this app to open the command prompt, which looks like this:

Text editor
In Windows, Notepad is the default text editor. However, Notepad++ is a much
better substitute.

[6]
Random documents with unrelated
content Scribd suggests to you:
[Transcription]

During my recovery I wrote that melancholy review of my past


life, which is printed in the ‘Annals.’
CHAPTER IX

PATRIOTIC PROPOSALS—1791-92

Illness—Correspondence with Washington—The King’s gift of a ram—


Anecdotes—Revising MSS.—Patriotic proposals—Death of the Earl of
Orford—Agricultural schemes—Correspondence.

The year opened with a continuation of that severe illness which


had confined me for some months. The following notes are from
a journal I kept at that time:—
This year my daughter Elizabeth married the Rev. Samuel
Hoole, son of the celebrated John Hoole, translator of Tasso and
Ariosto. He is a very sensible, moral man of strict integrity, and
always behaved to my daughter with much tenderness.
This same year my correspondence[139] opened with General
Washington. Having been applied to to procure some
implements for his husbandry, I wrote to him offering to procure
any article in that line which he might have occasion for, and
accordingly afterwards sent him many, amongst others the plan
of a barn, which he executed, and is represented by a plate in
the ‘Annals of Agriculture.’
This year his Majesty had the goodness to make me a present
of a Spanish Merino ram, a portrait of which I inserted in the
‘Annals.’
How many millions of men are there that would smile if I were
to mention the Sovereign of a great Empire giving a ram to a
farmer as an event that merited the attention of mankind! The
world is full of those who consider military glory as the proper
object of the ambition of monarchs; who measure regal merit by
the millions that are slaughtered; by the public robbery and
plunder that are dignified by the titles of dignity and conquest,
and who look down on every exertion of peace and tranquillity
as unbecoming those who aim at the epithet great, and
unworthy the aim of men that are born the masters of the globe.
My ideas are cast in a very different mould, and I believe the
period is advancing with accelerated pace that shall exhibit
characters in a light totally new, and shall rather brand than
exalt the virtues hitherto admired; that shall place in full blaze of
meridian lustre actions lost on the mass of mankind; that shall
pay more homage to the memory of a Prince that gave a ram to
a farmer than for wielding the sceptre obeyed alike on the
Ganges and on the Thames.
I shall presume to offer but one other general observation.
When we see his Majesty practising husbandry with that warmth
that marks a favourite pursuit, and taking such steps to diffuse a
foreign breed of sheep well calculated to improve those of his
kingdoms; when we see the Royal pursuits take such a direction,
we may safely conclude that the public measures which, in
certain instances, have been so hostile to the agriculture of this
country, have nothing in common with the opinions of our
gracious Sovereign; such measures are the work of men, who
never felt for husbandry; who never practised it; who never
loved it; it is not such men that give rams to farmers.
October 21.—A letter to-day from General Washington—
Gracious! from the representative of the Majesty of America, all
written with his own hand. Also one from the Marquis de la
Fayette desiring my assistance to get him a bailiff that
understands English ornamental gardening; for both he gives
fifty louis[140] a year—this is a French idea to unite what never
was united, and, when gained, reward it with wages little better
than a common labourer.
October 24.—Dined yesterday at Sir Thomas Gage’s to meet
the Miss Fergus’s and Dr. and Mrs. Onslow. This Dr. was the
youngest son of the late General Onslow, brother of my
godfather, the Speaker, in whose family my dear mother was for
many years upon the most intimate footing of private friendship.
When a boy I was frequently at his house, and well remember
having this Arthur, a child, on my knee. Mrs. Onslow mentioned
how much she had heard Mr. Boswell talk of my works. I fancy
Boswell, from some things I heard of him, and it seems
confirmed by various passages in his ‘Life of Johnson,’ has a sort
of rage for knowing all sorts of public men, good, bad, and
indifferent, all one if a man renders himself known he likes to be
acquainted with him. Mrs. Onslow reported to me the following
conversation which took place at the Prince’s table:—
The Prince of Wales, with a large company dining with him,
said, ‘The three greatest coxcombs in England are in this room.
Here is my friend Hanger,[141] the Duke of Queensberry must
come in for the second;’ he made a pause, enough for the
company to stare for the third, and added, ‘for the third, it is
certainly myself.’
When Sir W. Courtenay asked Lord Bute for a peerage, he
carried his pedigree with him. Lord Bute examined and
pretended to be a good judge of those things. He told Mr.
Symonds that nothing could be clearer or more unquestionable
than his descent lineally from Louis le Gros of France, the
relationship with the House of Bourbon which occasions the
mourning of a day in the Court of France for the death of a
Courtenay.[142] Lord Bute told him his demand of a barony was
too modest, and that he should be a Viscount, which he was
accordingly.
October 26.—In preparing my Travels [in France] for the
press, I experience strongly the importance of an author’s having
composed so much more than he means to print as to be able to
strike out largely.
My agreement with Richardson was to have six shillings a
volume for all sold of one guinea quarto volumes, but when
Rackham’s compositor came to cast off the MS. he found enough
for two large quarto volumes, since which discovery I had to
strike out just half of what I had written; and the advantage will
be very great to the work. I read the books as they are wanted
for the press again and again, reducing the quantity every time
till I get it tolerably to my mind, but yet not to the amount of
half. The work is certainly improved by this means, and I am
strongly of opinion if nine-tenths of other writers were to do the
same thing their performances would be so much the better; for
one reads very few quartos that would not be improved by
reducing to octavo volumes.
November 23.—I was five days last week at the Duke of
Grafton’s, Admiral, Mrs., and two Miss Pigots were there—she
[Mrs. P.] is sister to the Duchess, the Admiral is a very worthy
man—Mr. Stonehewer there also, and old Vary. I spent two days
in taking the level of the Duke’s river for four miles, in order to
see how much land he might water, and the improvement his
estate is capable of is very great indeed. The character of this
Duke is original; he is uncommonly sensible, there is no stuff in
him; he is cold, silent, reserved, and even at times sullen, and he
is removed from all that ease and suavity which render people
agreeable; yet there is such a solid understanding, and so much
learning and knowledge on certain topics, that one must value
him in spite of our feelings.
Very little of the conversation interesting enough to be worth
recording. I was also at a new club which Ruggles[143] has
instituted at Melford, which might have been an agreeable thing
had there been half a dozen only.
The following are [among] the letters preserved this year:—
From Dr. Burney, congratulations, pleasant anecdotes, and an
account of a large auction of books, &c.:—

‘Chelsea College: Jan. 7, 1791.

‘My dear Arthur,—The precipice on which you have so long


been scrambling for life seems to be more dangerous than any
one of those which I had to encounter from Sarzana to Genoa or
Genoa to Final. In the first of these scrambles during three days
and three nights on a mule without bridle (except that of Jack
Ketch) or saddle, I had a torrent called the Magra roaring in my
ears at a perpendicular distance of eight hundred or a thousand
feet, and, in the second, the Mediterranean, during a storm
which no vessel could weather. In the darkest night I ever saw,
with the artificial lights of our lanterns extinguished by the
violence of the wind, at every twenty or thirty yards the pedino
(a man on foot to guide the mule) cried out, “Alla montagna! alla
montagna, Signore!” which was an admonition to alight and
crawl on all fours over broken roads on the ridge of a precipice.
‘Now let me play the pedino’s part to your worship, and
admonish you to be very careful how you travel in the perilous
way to health which you have still to pass, after your escape
from the great precipice; for which escape, as an Italian would
say, “io me ne congratulo non meno con me medesimo che con
voi.”
‘But besides congratulating you on your amendment, I have
for some time wished to tell you that in the Paitoni catalogue of
Italian books now selling by auction at Robson’s room, there are
many on Natural History and Agriculture. Now as you have
dipped into Italian literature and farming, it struck me on seeing
the catalogue that there may be several works that you would
wish to purchase, particularly as the Italian books of Science
have hitherto sold at this auction for almost nothing. I purchased
nearly fifty volumes of poetry and miscellanies, and my bill did
not amount to five pounds. The books are in exceeding good
condition, and most of them such as have never appeared before
in the Osburn, Payne, or Robson catalogues. I am inclined to
think that this sale will enrich future catalogues in our country
for many years to come. Indeed I was so tired of eternally
meeting with the same book over and over again that I had no
longer patience to read them.
‘If you see any you wish I will get them purchased, but as
neither your Bibliomania nor mine has ever raged to such a
degree as to wish to buy in at any price, it will be necessary to
say that we mean not to vie with those who being more curious
in books than authors procure them at any price to look at and
not to read. A rich acquaintance of mine, and a customer of old
Tom Payne, has often bought books in languages of which he
knew not a single word, merely because they were beautifully
bound or very scarce.’

From another letter:—

‘I have not time nor space to lengthen my letter, or I should


tell you of a long conversation I had last Sunday at Lady Lucan’s
blue-stocking conversazione with Lord Macartney about you. He
has just come from Ireland and wanted to know whether you
were recovered—whether you come to London this winter, as he
wished to communicate some memorandums he made in
perusing your “Irish Tour” while he was in Ireland. He is a
charming man, to my mind.
‘Poor Fanny[144] has been very ill indeed, and we have been in
expectation of her coming to nurse, but she will risk the dying at
her Majesty’s feet to show her zeal before she can be spared, I
suppose.
‘I have had the great Haydn here, and think him as good a
creature as great Musician. As to operas, the Pantheon
advertises to open as a theatre; it is the most elegant in Europe,
Pacchierotti says, but it has great enemies. The Haymarket folks
have not yet obtained a licence, at which they affect surprise,
though they were told so before their building was a foot high.
Old Mingotti is come over with her scholar Madame Lobo, the
intended first woman of the Haymarket. It will be a busy and
memorable season in the history of tweedle-dum and tweedle-
dee quarrels.
‘Adieu!
‘Believe me,
‘Yours very affectionately,
‘Charles Burney.’

‘Chelsea College: Sept. 21, 1791.


‘My dear Friend,—I am quite ashamed of not answering your
kind and hearty letter of invitation sooner. But a listless and
irresolute disposition has made my mind for some time past as
flimsy as a dish-clout, and I must confess that I have invariably
"left undone those things which I ought to have done"—“for
there was no health in me,” indeed, not enough to enable me “to
do many things which I ought not to have done.” Original sin
and depravity just enabled me to read when I should have
written, and to lie in bed when I should have got up, &c. I
wished to commit other guess crimes than those, to have
rambled over a great part of the kingdom and revelled with
distant friends. But prudence, in the shape of rheumatism, and
in many other hideous shapes, prevented me. Yet, in spite of all
these admonitions, I had a month’s mind to accept of your
hospitable offer. But we have guests at our apartments now, my
two aged sisters, and, when they depart, winter will begin to
show his sour face and chain me to my chimney corner till after
Christmas, when I shall be unfettered, merely to be dragged into
the hurry and din of London, which are every year more and
more insupportable. I have long ceased to like the country,
except in long days and fine weather, and, in winter, prefer
London with all its horrors and fatigues to rural amusements.
Indeed, autumn with all its golden glow and variegated charms
for landscape painters is to me a constant memento mori, with
its withered leaves tumbling about my ears; and all my most
severe attacks of rheumatism have been during the equinoctial
winds and rains; so that I am afraid of trusting myself far from
home at this season of the year, as one can be sick and cross
nowhere so comfortably as at home.
‘Having scribbled my apology, I must now hasten to
congratulate you and Mrs. Young on the marriage of our dear
and worthy girl Bessy.[145] The match, indeed, is not splendid for
either in point of circumstances; but they are quite as likely to
scramble happily through life, with good hearts and wishes
limited to their means, as the richest peers and peeresses in the
land, who generally outlive their income, be it what it will, and
have mortifications incident to pride and disappointed ambition
which little folk know nothing about. They (I mean our young
couple) have my hearty benediction and good wishes. A man
without family attachments is an awkward and insulated being,
but a woman without a mate is still more insignificant and
helpless; and, having become adventurers in the matrimonial
lottery, I sincerely hope they will gain a prize in the fortuitous
distribution of such happiness as reasonable mortals have a right
to expect.
‘I dare not venture on French politics. What a marvellous
period in the history of that nation! I think the clergy and many
worthy people of the lower class of nobility have been cruelly
used, and that the mob is at present too powerful and insolent.
Too much has been promised them, and nothing short of an
agrarian law will satisfy them. The word tax, taille, impost, are
carefully avoided in the National Chart. But they must be levied
under some denomination or other, and, I fancy, “contribution”
will be as detestable a term in France, ere long, as “free-gift”
was in England during the last century. I wish the worthy people
of France may enjoy the rational liberty which seems now in
their power, but I question whether the inhabitants of that
kingdom in general will deserve the ample liberty which is
offered them, or know how to use it. I think them so fickle and
frivolous that I should not be surprised if in a few years they
were as tired of their new Government as the English at the
death of Oliver Cromwell. In the meantime what has happened
in America and France will shake every sovereignty upon earth.
The French Guards laying down their arms when ordered to fire
on the mob will make mobs formidable things in every country,
for whenever a similar defection happens a revolution must be
the consequence.
‘I am sorry not to be able to give your friend, Mr. Capel Lofft,
an account of any Lyre in modern times having been in use that
has been constructed, strung, and tuned on the principles of the
antients. Innumerable volumes have been written on their
division of the scale and genera. Kircher, indeed, calls a Vielle a
hurdy-gurdy, Lyra mendicorum. And a Viol da Gamba, with
additional strings and new tuning, was in the last century called
a Lyra-Viol. Mace,[146] Playford,[147] Simpson,[148] I believe, and
others describe this instrument. But though many modern
instruments have had the honour of being called Lyres, yet none
of them resemble the antient in their form or in the manner of
playing them. The Mandoline is the only modern instrument
played with anything like a plectrum. Vicenzio Galileo, the father
of Galileo, in his tract, “Della Musica antica e moderna,”
published at Florence 1602, speaks much of the similarity of the
antient Lyre and Cythara, but gives more proof from antient
authors of their difference than identity. He tells us, however,
that “the modern Harp, which is nothing but the antient Cythara
with many strings, was brought into Italy from Ireland.” Now the
Irish harp is a single instrument of few strings, partly brass and
partly steel, and of such small compass as to admit no bass,
being confined to mere melody. Carolan, the celebrated modern
Irish Bard, played only the treble part of tunes. And it seems to
me as if this simple instrument resembled the antient Lyre and
Cythara more than any other modern instrument with which I
am acquainted. Pray tell Mr. Lofft that I have examined Bonanni’s
description of all the musical instruments that are known, with
engravings of them all, but found nothing satisfactory about a
modern Lyre. This book was published at Rome 1722. I have
likewise looked into Ceruti’s new edition with corrections, 1776,
without success.
‘I am, my dear friend,
‘Yours affectionately,
‘Charles Burney.’

From Dr. John Symonds on the political state of the country—


an account of a conference between Mr. Pitt and the Duke of
Grafton:—

‘Bates’ Hotel, Adelphi: April 19, 1791.


‘My dear Young,—Hope you will not expect to hear me talking
on Agriculture; of that you will have a sufficient taste from
seeing the wonderful knowledge exhibited by all the House of
Commons in the Corn Bill. You will look for something on politics,
though the newspapers themselves sufficiently show the straits
to which Mr. Pitt is driven; for his majority is such as will ruin any
Minister if a war be unpopular; and had the American war been
so at first, it is not probable that Lord North would have dared to
pursue it, though he was so strongly supported in Parliament.
‘The truth is, some of Mr. Pitt’s bosom friends absolutely refuse
to vote with him on this occasion. Among these are Wilberforce
and Banks. The Duke of Grafton desired his son-in-law, Mr.
Smith, to tell Mr. Pitt he wished to have some conversation with
him; Mr. Pitt very politely came and staid half-an-hour, and the
Duke used every argument he could think of to convince him,
both of the impolicy and injustice of the war, "that the
augmentation of taxes coming upon the neck of the cessed
ones, and malt tax, which made a great noise, would occasion
universal discontent, if not worse effects; that we ought to lay
no stress upon the promises of a Turkish Ministry and
advantages in the Turkey trade, which must chiefly accrue to
France from her situation, and other causes; that what we could
do in the Baltic was merely to burn a few villages and distress
individuals, as the Russian fleet would lie securely among rocks,
that Russia appeared to act with moderation in desiring to retain
Ockzakow only; and that to plunge this nation into a vast
expense, merely to serve the King of Prussia’s views, when we
could obtain no benefit from it, would expose the Ministry to
very great censure, more especially as we entered into it as
volunteers, not being obliged to it by the terms of the Treaty."
Other things which his Grace said I omit, as every argument has
been used in the House of Commons. The conference ended as
conferences of this sort generally do—each of them kept to his
opinion.
‘You observe probably in the papers, that on Baker’s motion,
Pole Carew moved the previous question and contended “that
the interests of all are closely connected even in respect to
things not stipulated by treaty.” This judicious doctrine was first
advanced by the Chancellor, and Mr. Pitt defended in his speech
on Baker’s motion. According to this doctrine, there is no
difference between defensive and offensive treaties; all the
writer’s de jure gentium should be burnt, and, indeed, most of
the European treaties also; and it is certain that under such
circumstances England ought never to make an alliance on the
Continent unless a Continental war were actually broken out;
otherwise she could not foresee the consequences to which she
would be exposed.
‘Charles Fox said in his speech on Baker’s motion “that Mr. Pitt
dared not to enter into the war, and that he kept a majority
together at present by his assurance that there would not be
one.”
‘This is, perhaps, the case; but however it may be, it is certain
that Faukner, Clerk of the Council, is sent to Berlin, and most
persons think with a view of showing the King of Prussia the
impossibility of persuading this country to enter into a Russian
war. Had Mr. Pitt felt the pulse of the Parliament and people
before he delivered the King’s message, he would have saved his
credit, though he might have been blamed; but he has now run
into the horns of a dilemma, as the logicians call it. If he
prosecute the war, he will infallibly be ex-Minister, and bad
consequences are to be apprehended in a country oppressed by
taxes and heated by political pamphlets; if he give it ‘up, he will
lose all his influence in the eyes of Europe, and teach foreign
Courts that no confidence is to be placed in an English Minister.
His friends lament very much this last circumstance.
‘Adieu!
John Symonds.’

A circumstance in the exploits of my public career which


made, perhaps, a more general impression than any other event
of my life, was the proposal in 1792 for arming the property of
the Kingdom in a sort of horse militia. My first suggestion of this
idea was in May (of that year). Should any have claimed it, or
should any hereafter form such a claim, it ought in truth and
strict candour to be absolutely rejected. The proposal was more
formally made in August of the same year in the ‘Annals,’ vol.
xviii. p. 495, under the title of French events.[149] In the end of
1792 and the beginning of 1793 these papers were collected and
much enlarged in a pamphlet entitled, ‘The Example of France,’
&c. which ran speedily through four numerous editions, and
excited a very general attention. The author was publicly
thanked in resolutions of associated assemblies, and my great
plea of a horse militia produced almost immediately three
volunteer corps of cavalry, which multiplied rapidly through the
Kingdom. It is not known that any persons or any bodies of men
ever laid claim to a priority in this idea; accordingly my health
was the first toast given for being the origin of those corps,
which, when assembled, had this opportunity of publicly
declaring their opinion. The scheme took with astonishing
celerity, and became the parent of a measure of a very different
complexion, which was putting arms into the hands of thousands
without property, and upon whose allegiance and constitutional
principle but little reliance could be placed. Government received
demands for arms to the amount of above 700,000 men. The
Ministers were alarmed, and saw too late the consequence of
their own blindness and incapacity. They refused their consent,
in many cases without properly discriminating between men with
and without property, and felt themselves in so awkward a
position that it is no wonder their conduct continued void of any
steady adherence to the principle of the original proposition. Had
my plan not only been adopted but carried into execution,
strictly upon the principles I had explained, we might from that
moment to the present have had a horse militia, absolutely
under the command of Government, numbering from 100,000 to
200,000 men, which might, by progressive improvements, have
been matured into a force efficient for every purpose. It is very
seldom that so private an individual can by a happy thought
become the origin of a system which, had my principles been
steadily adhered to, would have been attended with
inconceivable benefit, and none of those evils, real or imaginary,
afterwards attributed to volunteers in general.
The pamphlet rendered the author exceedingly popular among
all the friends of government and order, and as unpopular
among the whole race of reformers and Jacobins. I was not
content with the mere theoretical idea, but in my own person
put it into practice, and enrolled myself in the ranks of a corps
raised at my recommendation, in the vicinity of Bury [St.
Edmunds], and commanded by the present Marquis of
Cornwallis, then Lord Broome, having with this intention learnt
the sword exercise at London of a sergeant, who was eminently
skilled in it. My example was followed by gentlemen of fortune,
several of whom were also in the ranks and refused to be
officers. This was a part of the plan of particular importance, for
had gentlemen accepted only the situation of officers, the spirit
of entering the corps among yeomen, farmers &c. would have
been much cooler; but when they saw their landlords, and men
of high consideration in the neighbourhood, in the same
situation, their vanity was flattered, and they enrolled
themselves with great readiness, and the great object of
property of such importance in case of revolutionary disturbance
was thus secured.
Some years afterwards, being at the Duke of Bedford’s at
Woburn, I sat at dinner by a gentleman of great property,
captain of a troop of yeomanry, who told me that whenever his
troop met he always drank my health after the King’s, for being
the undisputed origin of all the yeomanry corps in the kingdom,
possibly arising from extracts from my writings on the subject
having been much circulated in the newspapers.
This year my valuable and very sincere friend, the Earl of
Orford, died. The public papers that have announced the death
of this noble lord have recorded the ancestry from which he was
descended, the heirs of his honours, and the inheritors of his
wealth, and have dwelt upon the titles that are extinct or
devolved, together with all the posts and employments that are
vacant. To me be the melancholy duty of noting what is of much
more moment than the descent of a peerage or the transfer of
an estate—the loss of an animated improver; of one who gave
importance to cultivation by a thorough knowledge of political
economy, and bent all his endeavours towards making mankind
happy by seconding the pursuits of the farmer and the enquiries
of the experimentalist. I leave the lieutenancy of a county, the
rangership of a park, and the honours of the bedchamber to
those in whose eyes such baubles are respectable. I would
rather dwell on the merit of the first importer of Southdown
sheep into Norfolk; on the merit of sending to the most distant
regions for breeds of animals, represented as useful, not indeed
always with success, but never without liberality in the motive;
on the patron and friend of the common farmer, not the lord of a
little circle of tenants, but the general and diffusive encourager
of every species of agricultural improvement. Nor did he
associate with the useful men because he was not qualified for
the company of higher classes, for his mind was fraught with a
great extent of knowledge; it was decorated by no trivial stores
of classical learning, which exercised and set off the powers of a
brilliant imagination, and thus qualified, alike for a Court or an
Academy of Science, he felt no degradation in attending to THE
PLOUGH. By the death of this noble personage the ‘Annals’ have
lost a valuable correspondent, and their editor a warm friend.
Notwithstanding the immense list of Peers, seven or eight only
have become correspondents in this work. The insects of a
drawing-room, the patrons of faro, the luminaries of Newmarket,
are spared; while the hand of death deprives the farmer of a
friend, Norfolk of a protector, and England of a real patriot.
Lord Loughborough was the Judge at the Summer Assizes this
year at Bury, and I being on the Grand Jury, he sent a note to
inform me that he was alone at his lodgings, and desired me to
come and chat with him. This I did, of course, and in our
conversation he mentioned that there was an estate of 4,400
acres of land in Yorkshire on the moors, in the vicinity of Paitley
Bridge, to be sold for 4,000l., that it was chiefly freehold, and
enclosed with a ring fence, also that there was a neat shooting-
box on it built by the Duke of Devonshire, who hired the grouse.
I assured his Lordship that he must be mistaken, for it was
impossible that such a tract of land under several circumstances
which he named could be on sale for half an hour without being
purchased. He answered that nobody would buy it, as the land
was all moor or peat, and covered with ling, but that some
neighbouring farmers gave, he believed, 100l. per annum for the
whole as a walk for mountain sheep. I told him that it seemed so
extraordinary to me that I would go immediately to view it. He
said the proper persons to apply to to view it were Sir Cecil
Wray, Dr. Kilvington, and another gentleman. I accordingly went
immediately to Yorkshire, and, taking up my quarters at Paitley
Bridge, enquired till I found a person who knew the whole estate
perfectly well, and engaged him early the next morning in order
to make the tour of the whole property. It appeared to me to be
wonderfully improvable, and that very considerable tracts to the
amount of some hundred acres were palpably capable of
irrigation and improvement, evidently applicable from the case of
a small watercourse for conducting the water to an old smelting
mill, but long neglected. This course had overflowed and
converted the ling, over about fifteen acres, to grass. I asked my
conductor what this grass would let for with a small cottage and
stable for cows; he said, ‘Certainly fifteen shillings an acre.’ It
was sufficiently evident that improvements might be wrought at
a very small expense, and that building was remarkably cheap,
from every material except timber being found on the spot, and
lime at a small distance. There was a small farm in cultivation to
produce oats, and the appearance not unfavourable. As I knew
that a land surveyor well acquainted with all this country resided
at Leeds, I determined to go thither to bring him over to view,
and give his opinion as to the value of the property. This I did,
brought him over in a postchaise, and rode with him over the
principal part of the estate. His opinion confirmed my own, nor
must I forget to mention that this estate was to be purchased
without money as it was offered on its own security in mortgage.
In the enclosure of this immense waste, called forest, there
were two allotments purchased by the proprietors, one of 1,638
acres, and another of 1,113, in all 2,751 acres, which were a
copyhold tenure, at a small fine certain. In addition to which
they hired, at the same time, on a long lease, 1,614 acres more,
being an allotment to the King, at a rent of 50l. in money, and
50l. to be laid out on improvements. The whole, situated half-
way between Knaresboro’ and Skipton, I found walled in; three
farm-houses built, with barns and offices of various sorts, and
lands annexed, and partly subdivided, to the amount of about
400 acres; the remaining 4,000 in one vast waste. These farms
produced the rent of 44l. 5s. The game was let at 30l. with the
use of a handsome shooting-box, sufficient for the residence of a
small family. Peat dug from the bogs produced from 6l. to 8l. a
year; and the great waste was let at 100l. a year, which, for
4,000 acres, is at the rate of sixpence per acre. The annual
rental was therefore about 181l. per annum. From these
circumstances it appeared clear to me that the purchase could
not well be an unfavourable speculation. 2,750 acres (throwing
the leasehold entirely out of the question) for 4,400l. is exactly
32l. an acre fee simple for land that paid a mere trifle in poor
rates and land tax,[150] and tithe free; it did not seem therefore
to be necessary that the produce should amount to three
shillings, for if the rent was reckoned only at one shilling it was
but thirty-two years’ purchase. I determined, therefore, to make
it, and concluded the transaction as soon as possible.
My plan was, to let my farm in Suffolk, of about 300 acres,
and transfer the capital, with some additions, to the gradual
improvement of this large tract; and, in doing this, I should have
begun with one farm on the Southern extremity, near the
turnpike road, of three or four hundred acres, let separately for
20l. a year, but all a waste, and, in addition to this, have run a
watering canal from one of the streams, till from 100 to 200
acres were below the level, walling such tract in. Thus prepared,
I found myself at last in a situation to realise the speculations I
had so long been busy in—when a new scene of a very different
kind opened upon me—but of that hereafter.
The following are the letters of this year reserved. From J.
Symonds, Esq., an account of the Duke of Grafton’s illness:—

‘Euston: Jan. 30, 1792.

‘So you tell me that I know not how to stay at home! but this
is a visit of pure friendship, for the duke likes very well to chat
with me, though he is so nervous as hardly to bear with
strangers. Yesterday Lord Clermont, who is very intimate with
him, came hither, but he was too much for the duke, and had he
not gone away this morning, the duchess would have hinted it
gently to him. What would you do with such nerves?
‘Last night, instead of reading a sermon or charge, I read to
the whole company (by the duke’s desire) your essays on the
place of corn and capital employed in the French husbandry, with
which he had been so pleased. Lord Clermont, who has lived
much in France, and though a man of pleasure, had inquired
much into the state of that country, was not more delighted than
surprised with them. “Well, then,” said the duke, “as you like
them so much and intend to buy the book, recommend it as
much as possible to your friends in the great world.” This he
engaged to do. His Lordship gave a pressing invitation for you
and I to pass two or three days with him; he fixed upon the
month of May, which will suit me, and, I hope, you.
‘As an inducement I was to tell you that he has marled four
hundred and fifty acres with a hundred and twenty loads an acre
—this is an object.
‘J Symonds.’

J. W. Coke, Esq., M.P., proposing some laws for the benefit of


the poor in their present distress:—

‘Holkham: Oct. 23, 1792.


‘Dear Sir,—I have no better motive to urge for addressing
myself to you upon the subject of this letter than that I know of
no man so well qualified as yourself to give me the information I
stand in need of, should my plan be thought practicable and
useful by you, otherwise I should take shame to myself to
intrude for a moment on your time, which I esteem so precious,
as it is always most usefully employed in the most laudable
pursuits.
‘Having turned my thoughts much of late to the most probable
causes of the discontent among the lower classes of people in
this country, I find that the high price of provisions, especially of
bread, has been invariably the motive assigned by them
whenever they have assembled in a tumultuous manner. And this
is not surprising, as the existence of a poor man’s family must
depend upon that last-mentioned necessary article, most truly
his staff of life. It is surely, then, the interest, as well as the duty,
of the landed proprietors to endeavour by every means that can
be devised that the poor may never suffer in this respect. Now, it
has occurred to me that perhaps a Bill might be framed to fix an
assize on flour according to the average price of wheat.
‘That millers should be obliged to grind for all persons at a
certain sum per bushel instead of toll; persons being at liberty to
inspect their corn whilst grinding, and that allowance should be
made to millers for any alleged deficiency in grinding. All
complaints to be heard in a summary way before a Justice of the
Peace, and the complaint to be made within six days. The
average price of wheat to be taken from the nearest market at
the discretion of the Justice. Penal clauses should also be
enacted against millers adulterating wheat and mixing water
with the meal to increase its weight.
‘These loose hints I submit to your superior judgment and
better information; but, from my own observation, I do suspect
the poor suffer greatly from the shameful practices and
combinations of the millers, which I should be proud to check by
bringing a Bill into Parliament as one of the representatives of
the great arable county, should you approve the idea and would
have the goodness to lend me your assistance in framing the Bill.
‘I must also mention another cruel grievance to the poor, that
there is no legal restraint on shopkeepers in villages respecting
their weights and measures.
‘Could no means be devised to protect the buyer from the
artifices of the seller without injury to the latter in their honest
gains? Why might not magistrates have the power of punishing
for short weights and measures, complaint to be made within six
days?
‘I remain, dear Sir.
‘Yours very sincerely,
‘J. W. Coke.’

From Dr. Burney on my ‘Travels’ and his own engagements:—

‘Chelsea College: July 17, 1792.

‘My dear Friend,—Your very kind and hearty invitation to


Bradfield came at a time when I was utterly unable to answer it.
I was just emerged from the sick room into daily hurry and
business, for which I was but little fit, and am still detained here
by an unusual number of engagements for this time of year, the
end of which I am not able to see. If my patients had walked off
as early as I wished them, or if, like other doctors, I could have
them put to their long home by a dash of my pen, I really
believe I should not have been able to resist the lure you threw
out; but now, if I am able to travel, or fit for any house but my
own, I have two positive engagements on my hands of long
standing: the first to Mickleham, to my daughter, Phillips, where
I promised, as soon as I could pronounce myself a convalescent,
to go and complete my cure; the other is to Crewe Hall, in
Cheshire, whither I have been going more than twice seven
years; and at which place I was so sure of arriving last August,
that my correspondents, at my request, addressed their letters
to me there. This year the claims upon me and Fanny have been
so powerfully renewed by Mrs. Crewe that nothing but increased
indisposition can resist them. She has promised to carry us down
by slow journeys, and, if it should be necessary for me to go to
Buxton for my confounded rheumatism (which, though less
painful, still deprives me of all use of my left paw), she will even
accompany me thither. My poor wife is also in sad health, and
we are neither of us fit for anything but to con ailments with
those who are as old and infirm as ourselves. But we send you a
splinter[151] from us, before we were quite broke up and unfit for
service. It is not sufficient to improve your fire of a wet day, but
may perhaps be of some little use in the way of kindling.
‘I thank you heartily for your very interesting book of “Travels.”
It is in public perusal of an evening, and has fastened on us. The
parts of France which you have traversed were to me almost
unknown. I never saw the Loire or the Garonne. No one can
accuse you of drowsiness, like old Homer and such folks; you are
always awake, and keep your readers so. We are now in the
midst of that most astonishing of all events, the French
Revolution, and like your narrative extremely. Though an enemy
to the old tyranny, you neither reason about the rights of man
like Wat Tyler or even Tom Payne. You saw coming on all the
evils which anarchy has occasioned. You have long seen the
futility of theory without practice among French agriculturists,
and the political philosophers who think themselves wiser than
the experiences of all antiquity, and not content with anything
already done, must needs set about inventing an entire new
government, and you see what a fine mess they have made of it.
‘Yours ever,
‘Charles Burney.’

From Miss Burney, afterwards Mdme. d’Arblay, writing on some


traits of my character, &c.:—

‘Chelsea College: July 17, 1792.


‘Nay, if you talk of your difficulties in fabricating an epistle to
me, please to consider how much greater are mine in attempting
to answer it. You! a country farmer, the acknowledged head of
“the only art worth cultivating,” as you tell us,—the contemner of
every other pursuit, the scorner of all old customs, the defier of
all musty authorities, the derider of all fogrum superiors,—in one
word a Jacobin. You afraid? and of whom? a Chelsea pensioner?
One who, maimed in the royal service, ignobly forbears, spurning
royal reparation? One who, though flying a court, degenerately
refrains from hating or even reviling kings, queens, and
princesses? One who presumes to wish as well to manufactures
for her outside, as to agriculture for her inside? One who has the
ignorance to reverence commerce, and who cannot think of a
single objection to the Wool Bill? One, in short, and to say all
that is abominable at once, one who in theory is an aristocrat,
and in practice a ci-devant courtier?
‘And shall a creature of this description, the willing advocate of
every opinion, every feeling you excommunicate from “your
business and bosom,” dare to write to you? Impossible!
‘Whether I shall come and see you all or not is another matter.
If I can I will.

‘P.S. Will Honeycomb says if you would know anything of a


lady’s meaning (always providing she has any) when she writes
to you, look at her postscript. Now pray, dear sir, how came you
ever to imagine what you are pleased to blazon to the world with
all the confidence of self-belief, that you think farming the only
thing worth manly attention? You, who, if taste rather than
circumstance had been your guide, might have found wreaths
and flowers almost any way you had turned, as fragrant as those
of Ceres.’

My reply:—
‘You, “the willing advocate of every feeling I excommunicate
from my bosom,” knew you had thrown so bitter a potion into
your letter that you could not (kind creature!) help a little
sweetening in the postscript; but must there in your sweets be
some alloy? Could you not conclude without falling foul of poor
Ceres?
‘Your letter, or rather your profession of faith, is one of the
worst political creeds I remember to have read; you see no merit
but beneath a diadem. In government a professed aristocrat, in
political economy a monopolist, who commends manufactures,
not as a market for the farmer, but for the much nobler purpose
of contributing to adorn your outside; and who can attain not
one better idea of the immortal plough than that of giving some
sustenance to your inside. But, by the way, is not that inside of
yours an equivoque? Do you mean your real or your
metaphorical inside, your ribs or your feelings? If you allude to
your brains, they are by your own account a wool-gathering. Do
you mean your heart, and that the philosophical contemplation
of so pure an engine as the plough is the sustenance of your
best emotions? How will that agree with the panegyrist of a
court and the satirist of a farm? Or is it that this inside of yours
is a mere bread and cheese cupboard, which, certes, the plough
can furnish? Or is it a magic lanthorn full of gay delusions,
lighted by tallow from the belly of a sheep? Till you have settled
these doubts, I know not which you prefer, manufactures for
improving your complection, or agriculture for farming your
heart. Nor must you wonder at such questions arising while you
use terms that leave one in doubt whether you mean your head
or your tail. I know something of the one; the other is a
metaphor. Though there is high treason against the plough in
almost every line of your letter, yet the words If I can I will are
not in the spirit that contains the Eleusinian mysteries; they
bring balm to my wounded feelings.’
CHAPTER X
THE BOARD OF AGRICULTURE, 1793

The Board of Agriculture—Secretaryship—Residence in London—Twenty-five


dinners a month—The King’s bull—The Marquis de Castries—‘The
Example of France’—Encomiums thereof—Correspondence.

The most remarkable event of this year was the establishment of


the Board of Agriculture.[152] I found that Mr. Pitt had determined
that I should be secretary, and Mr. Le Blanc, of Caversham,
informed me that this new board was established with a view of
rewarding me for my ‘Example of France.’ In a conversation with
Lord Loughborough on the attendance required, he remarked,
‘You may do what suits yourself best, I conceive, for we all
consider ourselves so much obliged to you that you cannot be
rewarded in a manner too agreeably.’ If the appointment of
secretary be considered, as it has been by many, a reward for
what I had effected, it was not a magnificent one; the salary,
400l. per annum, would have been desirable had it left me more
time in Suffolk, but when I found a very strict attendance
attached to it, with no house to assemble in except Sir John
Sinclair’s, and in a room common to the clerks and all comers, I
was much disposed to throw it up and go back in disgust to my
farm; but the advice of others and the apprehension of family
reproaches kept me to the annoyance of a situation not
ameliorated till Sir John was turned out of the Presidentship by
Mr. Pitt, and the Board procured a house for itself.
My letter to Mr. Pitt, asking for the secretaryship of the new
Board of Agriculture:—
‘Bradfield Hall: May 20, 1793.

‘Sir,—I am informed by Lord Sheffield and Sir John Sinclair that


the establishment of a Board of Agriculture is determined.
‘It has been the employment of the last thirty years of my life
to make myself as much a master of the practice and the
political encouragement of agriculture as my talents would allow.
I have examined every part of the kingdom, and have farming
correspondents in all the counties.
‘It is impossible I should know what is your intention in
relation to the office of the secretary; but the same wisdom that
established the Board will, without doubt, give such an
appointment to that office as may fill it in a manner the best
adapted to the business.
‘Should I be happy enough to appear in your eyes qualified for
such a post, and you would have the goodness to name me to it,
it might lessen the anxieties of a life that has been passed in the
service of the national agriculture; and I should feel with
unvarying gratitude the obligation of the favour.
‘I have the honour to be, sir, with the greatest respect,
‘Your most humble and obedient servant,
‘Arthur Young.’

My reply to George Rose, Esq., on his communicating to me


Mr. Pitt’s approbation of my appointment:—

‘Bradfield Hall: May 30, 1793.

‘Sir,—It is with pleasure that I acknowledge the receipt of your


letter, as it shows that, whatever may be the result of the
present business, my exertions have met with the approbation of
Government, whose public-spirited and laudable views I have
long been solicitous to second.
‘The salary you mention is, I confess, less than I imagined
would be assigned to the office, but its being adequate or not
depends entirely on the circumstances of attendance, duty,
residence, &c. If these be arranged on a footing any way liberal,
the sum is equal to my desires; and I shall in that case accept
the office with pleasure. If, on the contrary, these points be so
fixed as to overturn my present pursuits in life, they would
render a larger salary less valuable to me than the sum you
mention.
‘From the nature of the Board, intended to consist, as I
understand, of members of the two Houses, with the objects in
view, I take it for granted that the points above mentioned may,
without the least impediment to the business, be easily
arranged. ‘Trusting in this entirely to Mr. Pitt and yourself, I beg
your good offices that, if I should have improperly expressed my
meaning, you will do me the justice to rely on the integrity of my
views, and not imagine me eager in making a bargain for profit
with a great and liberal benefactor.
‘I have the honour to remain &c.
‘Arthur Young.’

What a change in the destination of a man’s life! Instead of


becoming the solitary lord of four thousand acres, in the keen
atmosphere of lofty rocks, and mountain torrents, with a little
creation rising gradually around me, making the black desert
smile with cultivation, and grouse give way to industrious
population, active and energetic, though remote and tranquil,
and, every instant of my existence, making two blades of grass
to grow where not one was found before—behold me at a desk
in the smoke, the fog, the din of Whitehall. ‘Society has
charms’—true; and so has solitude to a mind employed. But the
die is cast, and my steps may still be said, metaphorically, to be
in the furrow. My pleasures are of another sort; I see daily a
noble activity of zeal in the service of the national husbandry in
the President—of that happy effort of royal patriotism,
commendable and exemplary; and I see in so many great and
distinguished characters such a disinterested attention to the
public good, and such liberality of spirit in promoting it, that the
view is cheering, whether in a capital or a desert.
The two situations were incompatible with each other. I
therefore advertised the estate for sale; and nothing proves to
me how very ill understood waste lands are in this kingdom than
the advertisement being repeated near a twelvemonth before I
could sell it with much less profit than I had reason to expect. So
large a contiguous tract, in many respects so eligible for
improvement, I thought would have been a favourite object with
numbers; as to the ignorance of those who viewed and rejected
it, I can only pity them.
The attention I received from individuals was, however, very
flattering, for I find, by an old memorandum book, that I dined
out from twenty-five to thirty days in the month, and had, in that
time, forty invitations from people of the highest rank and
consequence. Here I copy a memorandum made at the time:
August 21, ‘I feel an advancement of a certain kind since the
publication of my Travels, well calculated to add agreeably to a
new sphere in life by means of this new Board; but how it will
turn out is not easy to conjecture, and my “Example of France: a
Warning to Great Britain”[153] is applauded in a manner of which I
had not the slightest conception. The Ministry commend it most
highly, and express themselves in [a way] truly gratifying to my
feelings. The last time I was in town, the Chancellor dwelt on the
idea of how much they were all obliged to me, and treated me
as a man that must be gratified when I was explaining my wish
to reside but little in London. And Rose’s report from Mr. Pitt was
equal; his own expression was that I had beat all rivalship and
produced the most useful work printed on the occasion, &c.
Thus I come with all the advantages I could wish—and I could
see in every eye and hear from every tongue of numbers to
whom Sir John Banks introduced me on the Terrace at Windsor
that I was considered as one to whom the nation was obliged.
The King spoke to me, but not so graciously as some years
before; and this brought to my mind a visit which Mr. Majendie
and his brother, the Canon of Windsor, paid me at Bradfield,
when the latter asked me in a very significant manner whether I
had not said something against the King’s bull, as it was
commonly reported that I had fallen foul of his Majesty’s dairy;
so I suppose the man who showed me the cattle reported to the
King every word I had said of them, and possibly with additions.
Who is it that says one should be careful in a court not to offend
even a dog? However, Sir J. Sinclair reported to me some days
afterwards that his Majesty had expressed to him great
satisfaction at my appointment to the secretaryship of the
Board.’
About this time I met Sir John Macpherson, from Bengal, but
now from Italy. He came by the Rhine; had a conversation with
the King of Prussia on my ‘Travels,’ which his Majesty was
reading, and commended greatly. He saw also the Marshal de
Castries,[154] who was likewise reading them, and praised me in
the highest terms. Sir John Macpherson told him that he had
found my accounts of Lombardy so uncommonly just and
accurate that he intended seeing the author as soon as he
arrived in England. ‘Tell him, then,’ said the marshal, ‘that I did
not know France till I read his admirable work, which astonishes
me for its truth, and extent and justness of observation;’ and the
next day he wrote to him pointing out an error of mine in the
passage relating to his opening the French West Indies to foreign
navigation. No man can speak in higher terms of a book than Sir
John does of this. He says it is the best that ever was published.
It is something whimsical that the ladies should tell me it is as
entertaining as a romance, and that statesmen should praise it
for its information. Faith! I had need be flattered to be kept in
good humour—losing my time doing nothing in London in
August.
September 9.—Dined at Pinherring’s, the American
ambassador; he is a gentleman-like man; but for his company,
though this was a great entertainment, there was such a motley
group as would be difficult to find; they were so indelicate as to
call for a war with England.
I preserved the following among letters of this year:—
From the Countess of Bristol
‘January 4, 1793.

‘Dear Sir,—In spite of a bad cold, which makes me very heavy


and ill qualified to write to un homme d’esprit, I must say a word
or two in answer to your letter, and also assure you that the one
you enclosed for Lord Bristol was forwarded by the same post to
his agent in town.
‘Do I recollect reading your "Travels"? Yes, certainly, and the
great pleasure and instruction I received from them; but the
approbation, I assure you, came from a better quarter, or I
should not have presumed on its being worth your acceptance.
However that may be, I am much pleased with the effect, and
fairly confess that I did wish to set your pen a-going, because
you had experience and facts to write upon, and that I knew
your warm colouring would suit the picture—in short, I saw you
were a convert. I wished you to make others, and if I have been
the least instrumental by awakening the spark in you, I shall feel
that I am not wholly useless to the community where providence
has placed me. I think everybody with talents is called upon,
particularly at this time, to use them for the good of their once
happy country, and I know of no one better qualified than
yourself to employ your eloquence usefully.
‘The pamphlet you mention, of an earnest address to farmers,
was brought to me amongst others, and I immediately said it
was yours—but pray rescue it from its mangled state and print it
again as it was written. I flatter myself that you intend to send
me the “Example of France: A Warning to Britain,” for which, I
assure you, I am very impatient.
‘I write from Lord Abercorn’s, and wish I could hear anything,
but upon every subject there is at this moment an awful pause.
It is hoped that the Alien Bill may be passed to-morrow, it is so
much wanted, and that the wretched state of the French armies
and their dissentions at home may make it unnecessary for us to
declare war. Three Prussian officers of rank have been arrested
for treasonable correspondence with Dumouriez, which, they
say, is to explain the Duke of Brunswick’s retreat; and now it is
supposed that Custine’s army cannot escape him.
‘I saw two gentlemen who were in Paris a fortnight ago, and
who told me that the treasury would hold out very little longer,
that bread was scarce, commerce destroyed, and the people
either in fury or despair, the whole town affording a melancholy
scene of poverty, distrust and disorder—houses shut up, public
buildings destroyed, churches turned into warehouses, &c. &c.
‘For want of better materials I send you a print which I think is
not a bad one, considering the double part Mr. Fox has acted. I
thank you for enquiring after my daughters. Lady Erne is not yet
returned from Hampshire, Lady Elizabeth is with the Duchess of
Devonshire at Florence, and Lady Louisa is here, and desires her
compliments.
‘I am, sincerely yours,
‘E. Bristol.’

From the same


‘Bruton Street: March 20, 1793.

‘Dear Sir,—I have just seen in the True Briton of this morning
that the thanks of the association at the “Crown and Anchor”
were voted to you for your last publication, which, I assure you,
gives me great pleasure; at the same time it reminds me that I
have too long deferred mine, but which I now beg you will
accept. I like it very much, and think it is admirably well written,
and calculated to inform the ignorant and deluded of their real
danger. I should have told you so long ago, but waited to hear
the opinions of those from which I thought you would receive
more satisfaction; and I can now assure you that your pamphlet
is much liked by Lord Orford and several others of good
judgment. And I think you may, without flattery, consider
yourself as one of the means which has rescued this glorious
country from the destruction which was preparing for it.

You might also like