Rapid Python Programming Gunnells William C download
Rapid Python Programming Gunnells William C download
download
https://ebookbell.com/product/rapid-python-programming-gunnells-
william-c-22122920
https://ebookbell.com/product/python-programming-versatile-highlevel-
language-for-rapid-development-and-scientific-computing-mastering-
programming-languages-series-edet-71592228
Rapid Gui Programming With Python And Qt The Definitive Guide To Pyqt
Programming 6 Print Summerfield
https://ebookbell.com/product/rapid-gui-programming-with-python-and-
qt-the-definitive-guide-to-pyqt-programming-6-print-
summerfield-22041670
Rapid Gui Programming With Python And Qt The Definitive Guide To Pyqt
Programming Paperback 1st Edition Summerfield
https://ebookbell.com/product/rapid-gui-programming-with-python-and-
qt-the-definitive-guide-to-pyqt-programming-paperback-1st-edition-
summerfield-36002214
Rapid Gui Programming With Python And Qt The Definitive Guide To Pyqt
Programming Mark Summerfield Mark Summerfield
https://ebookbell.com/product/rapid-gui-programming-with-python-and-
qt-the-definitive-guide-to-pyqt-programming-mark-summerfield-mark-
summerfield-7265650
Cherrypy Essentials Rapid Python Web Application Development Design
Develop Test And Deploy Your Python Web Applications Easily Sylvain
Hellegouarch
https://ebookbell.com/product/cherrypy-essentials-rapid-python-web-
application-development-design-develop-test-and-deploy-your-python-
web-applications-easily-sylvain-hellegouarch-36001702
https://ebookbell.com/product/mobile-python-rapid-prototyping-of-
applications-on-the-mobile-platform-rapid-prototyping-of-applications-
on-the-mobile-platform-scheible-22105728
https://ebookbell.com/product/mobile-python-rapid-prototyping-of-
applications-on-the-mobile-platform-1st-ed-scheible-10812198
https://ebookbell.com/product/mobile-python-rapid-prototyping-of-
applications-on-the-mobile-platform-jrgen-scheible-43150154
https://ebookbell.com/product/mobile-python-rapid-prototyping-of-
applications-on-the-mobile-platform-tuulos-61065100
Rapid Python Programming
William C. Gunnells
1st Edition
Copyright © 2017 by William C. Gunnells. All rights reserved. No part of
this book may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any
information storage or retrieval system, without prior written permission
from the publisher.
Notice of Liability
Every effort has been made to ensure that this book contains accurate and
current information. However, in rapidpythonprogramming.com and the
author shall not be liable for any loss or damage suffered by readers as a
result of any information contained herein.
Trademarks
All trademarks are acknowledged as belonging to their respective companies.
Editor
For copy editing and instructor-led training contact Rachel Gunnells via
email rachelgunnells@icloud.com
Contact
For information about buying this title in bulk quantities, or for special sales
opportunities, please contact author via info@rapidpythonprogramming.com
or visit us on the web at http://www.rapidpythonprogramming.com
Code can be found at:
https://github.com/thecount12/rapidpythonprogramming
Rapid Django Install Script – Complete with blog can be found at:
https://github.com/thecount12/rapiddjango
ISBN-13: 978-1541043084
ISBN-10: 1541043081
Table of Contents
William C. Gunnells 1
1st Edition 2
Notice of Liability 2
Trademarks 2
Editor 2
Contact 2
Preface 8
How to use this book 9
Conventions 9
Code and Errata 9
Acknowledgments 10
Author 10
Network Penetration 10
Programming 10
Network Security and Forensics Investigation: 10
1 Introduction 11
1.1 Introduction 11
1.1.1 History 13
1.1.2 Installation 13
1.1.3 Windows 13
1.1.4 Linux 13
1.1.5 Editors 14
1.1.6 Case Sensitive 14
1.1.7 Additional Packages 14
1.1.8 Versions 14
1.1.9 Installation and Configuration 15
1.1.10 Python Interactive Prompt 15
1.1.11 Making a Python Script 16
1.1.12 Summary 17
1.1.13 Exercises 17
2 Strings – Operators - Conditions 17
2.0.14 Strings 17
2.0.15 Variables and Assignment 19
2.0.16 Operators, Order, Indent 19
2.0.17 Pitfalls 20
2.0.18 Integer Conversion 20
2.1 Conditions and Indentation 20
2.1.1 Flow Control if/else 20
2.1.2 For Loop 21
2.1.3 While Loop 21
2.1.4 Examples 21
2.1.5 Conditions and Indentation 22
2.1.6 Summary 23
2.1.7 Exercises 23
3 Input – Data structures, Modules 24
3.1 Input Function 24
3.1.1 input() 24
3.1.2 raw_input() 24
3.1.2.1 Guess Program 25
3.1.3 Declare a Function 25
3.1.4 Functions with Parameters 26
3.1.5 Functions with Default Arguments 26
3.2 Data Structures 26
3.2.1 help(list) 26
3.2.2 help(tuple) 27
3.2.3 Tuple in Print Statement 27
3.2.4 Dictionary 27
3.2.5 Sequence 28
3.2.6 More on Strings 28
3.3 Modules 28
3.3.1 sys Module 29
3.3.2 Practical Usage: 30
3.3.3 from import 30
3.3.4 Testing a Module 31
3.3.5 Summary 31
3.3.6 Exercises 31
4 Files 32
4.1 File 32
4.1.1 The Basics 32
4.1.2 Variations of Reading Data 32
4.1.3 Parsing a file 33
4.1.4 Binary Files 34
4.1.5 Pickle 34
4.1.6 Let's Pickle 34
4.1.7 cPickle 35
4.1.8 Python with Statement 36
4.1.8.1 File Handling Modes 36
4.1.8.2 File A ttributes 36
4.1.9 Deep Binary Manipulation 37
4.1.9.1 bit string manipulation 37
4.1.10 Binary Struct 39
4.1.11 Summary 40
4.1.12 Exercises 40
5 Exceptions 40
5.1 Exceptions 40
5.1.1 Raise Exception 42
5.1.2 Finally 43
5.1.3 Best Practice 43
5.1.4 Ignore Exception 44
5.1.5 Summary 44
6 OOP 44
6.1 Object Oriented Programming 44
0.1.1 Intro 44
6.1.2 Objects 44
6.1.3 Self and Class 45
6.1.4 __init__ 45
6.1.5 Destructor 46
6.1.6 Inheritance 46
6.1.7 __private 47
6.1.8 The Kung Fu of Class 47
6.1.9 Iterate Over Unknown Objects 48
6.1.10 Multiple Inheritence 49
6.1.11 Summary 49
7 Cool Features of Python 50
7.1 Cool Features of Python 50
7.1.1 List Comprehension 50
7.1.2 Lambda 50
7.1.3 Assert 51
7.1.4 eval 52
7.1.5 exec 52
7.1.6 repr 52
7.1.7 switch or case 53
7.2 Converting to OOP with pass 54
7.2.1 Convert to OOP using pass 55
7.2.2 Initialize method of conversion 56
7.2.3 Last part conversion 56
7.2.4 Test Locally 57
7.3 Generators 57
7.4 Threads 60
8 EasyGUI 64
8.1 EasyGUI 64
8.1.1 EasyGui Discontinued 71
8.1.2 Exercises 71
9 Tkinter 71
9.1 Tkinter 71
9.1.1 The Basics 71
9.1.2 Simplify with functions 73
9.1.3 Widgets 77
9.1.4 Entry widget in depth 82
9.1.5 Practical Example 84
9.1.5.1 Stock market Calculator prototype 84
9.1.6 Exercises 86
10 WxWidgets 86
10.1 Wx-widgets 86
10.1.1 PythonCard 90
10.1.2 PythonCard Application 93
10.1.3 Summary: 97
11 Sockets and Databases 98
11.1 socket programming 98
11.1.1 TCP sockets 98
11.1.2 UDP sockets 101
11.2 Database SQLite 102
11.2.1 SQLite Primer 102
11.2.2 Python SQLite 104
11.2.3 Exercises 105
12 CGI, WSGI Framework Development 105
12.1 CGI 105
12.2 WSGI 109
12.2.1 Creating a Web framework 110
12.2.2 Summary 113
12.2.3 Exercises 114
13 Django 114
13.1 Django 114
13.1.1 Setting up django 114
13.1.2 start project 114
13.1.3 Create a view 115
13.1.4 Dynamic content: datetime() 116
13.1.5 Templates 116
13.1.6 Free HTML development 116
13.1.7 Admin screen 117
13.1.8 Static Content 120
13.1.9 Basic Blog 120
13.1.10 Blog with Comments 122
13.1.11 Registration 129
13.1.12 CBV vs FBV 130
13.1.13 exercises 132
14 Apache, Heroku, AWS and Cloud 132
14.1 Additional Django Features 132
14.1.1 Heroku 133
14.1.2 Amazon AWS S3 storage 135
15 UML 138
15.1 UML 138
15.1.1 Use Case diagrams 138
15.1.2 Class diagrams 139
15.1.3 Object diagrams 139
15.1.4 Activity diagrams 140
15.1.5 Dia and UML 141
15.1.6 Exercises 147
16 Game Programming 147
16.1 Game Programming 147
16.1.1 Where to begin? 147
16.1.2 Above all! 148
16.1.3 Graphics 148
16.1.4 Minimum requirements for a Game Programmer 148
16.1.5 Game Theory 148
16.1.6 Prototype 149
16.1.7 Zero-sum 149
16.2 Pygame 150
16.2.1 Screen Initialization 150
16.2.2 Event Handling 151
16.2.3 Borders 153
16.2.4 Game loops and text 154
16.2.5 Images 157
16.2.6 Collision detection 158
16.2.7 Summary parts of a game 159
16.2.8 Game Engine Architecture 160
16.3 Creating a Game Summary 161
17 Stock Market 161
17.1 Stock Market 161
17.1.0.1 Yahoo 162
18 Closing Thoughts 167
18.1 Closing Thoughts 167
Appendix A 168
Python Card uses OSI BSD Licensing: 168
Open Source Initiative OSI - The BSD License:Licensing 168
The BSD License 168
Appendix B 169
Pygame uses LGPL Licensing: 169
GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February
1999 169
Preamble 169
GNU LESSER GENERAL PUBLIC LICENSE TERMS AND
CONDITIONS FOR COPYING, DISTRIBUTION AND
MODIFICATION 171
Appendix C 176
Python uses the following license. 176
PSF LICENSE AGREEMENT FOR PYTHON 2.7.1 176
BEOPEN.COM LICENSE AGREEMENT FOR PYTHON
2.x 177
BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT
VERSION 1 177
CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 178
ACCEPT 179
CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH
1.2 179
Preface
Python is one of the few programming languages that is not only easy to
learn but also very powerful. Most books on programming focus on the skill
level of the reader rather then the topic for which the reader picked the book.
I got the idea to write this book after reading ``Programming - Principles and
Practice Using C++ written by Bjarne Stroustrup the creator of C++
programming language. While everything here will be presented differently,
the philosophy of programming, learning and the methods he presented is
what influenced me the most.
Programs by nature evolve towards complexity and most languages foster the
ability to design in a structured way even if the language is not a structured
programming language. Python supports multi-paradigms (such as object
oriented, imperative, and functional). The design of Python leans towards a
clean modular style with everything loosely considered an object.
Once you start programming with python, you won't want to use other
languages. You may even find yourself converting code written in other
languages to python. Python is very fast. You can compile your code into
Byte-compiled files or PYC files. These pre-compiled binaries execute
quickly. Conveniently Byte-compiled files that are created by the python
interpreter automatically and can be further extended with other python
modules. If you decide to use python for science, or gaming, and you need
more speed, you can further extend python with the “C” language. The
flexible features of python make it an excellent choice for beginners and
experts. Most important, programming with python is fun.
For the more experienced developer, python can be learned on a one page
cheat sheet. Taking into account the range of skill levels and learning styles,
my idea was to provide just enough examples to learn the language then
introduce the reader to the fun tools. The reality is that the beginner will learn
just enough to program then comb through endless “Google” pages to
understand tasks such as: parsing large files, working with a database, doing
network programming, creating a graphical interface, designing a website,
developing a game, or modeling and stock market analysis. My goal is to
teach the student just enough that they feel confident jumping right into the
fun stuff.
Here are some of the highlights:
EasyGUI
This is a wonderful chapter for newbies, providing you a graphical
environment in which to program
Tkinter
Now that the reader has cut their teeth on the basics of EasyGUI, it's
only a few more steps to writing Tkinter applications without
EasyGUI templates.
WxWidgests
WxWidgets is one of the most popular cross platform GUI libraries
available. It is used by a lot of popular high level programming
languages.
Network Programming
This chapter explains how to use sockets, and build client and server
applications.
SQLite
Chapter 19. Is about SQlite, a very lightweight SQL server, that has
many advantages over a traditional SQL server. It's really easy to
learn and easy for Python to connect to.
CGI
Often enough Web application developers run into certain
limitations. The client might have a server co-located with a
provider that only supports PHP and CGI. This chapter explains how
to utilize python with CGI.
WSGI
Web Server Gateway Interface. It is a specification for web servers
and application servers to communicate with web applications.
Pygame
This chapter is about the Pygame library, how to utilize it, a short
tutorial, examples, and options for deployment.
Acknowledgments
This book would not have been possible without the guidance and support of
many people in my life.
Thanks to my friends who have always encouraged me through trials and
tribulations navigating the fiercely competitive computer technology
industry. They always encouraged me to remember to stay focused and
believe in myself.
Thanks to Dennis Feick who had enduring faith in my family during some of
the worst economic times as a programmer these last 7 years.
Thanks to the wonderful programmers I've known and worked with: Dan
White and Daniel Yount have both been helpful and inspirational in this
matter. I appreciate their tutelage over the years. It was a pleasure working
with them.
Thanks to my family, Rachel, Olaf, and Mckinzie who stood by me and
endured the late hours of work, overtime, and sacrifices made as a writer
while working multiple jobs.
Author
William Gunnells has been building computers since he was 10 years old.
While hardware is his passion he loves to exploit the various hardware
features through software. Hardware has changed so much in the last 30
years. The market wants smaller, faster, better. It's the same with software.
Python is smaller, faster, and better. With more than 25 years as a
programmer, network engineer, and security engineer. He designs and
engineers from scratch full service solutions using open source tools to
enterprise standards for the target market. His diverse background is as
follows:
Network Penetration
Working knowledge of buffer overflows, race conditions, protocol hijacking,
replay attacks, stealth attacks, network sniffing, password cracking, denial of
service, spoofing, covert channels, network tunneling, connection bouncing,
system call hijacking and “Userland rootkits”. Concentrated knowledge on
TCP/IP and network attack scenarios.
Programming
He is proficient in shell scripting (bash, CSH), C, Perl, Python, PHP, GNU
debugger and build tools (Automake, Autoconf, Libtool), Version Control
(CVS, RCS), Perforce, GIT, and SVN on large-scale development projects.
Extensive experience at utilization of both asymmetric and symmetric
ciphers. He has developed custom code for OpenBSD and Linux Loadable
Kernel Modules (LKM). Experience using Queue, Libnet, Libpcap, Pthreads
and Ncurses API's. Extensive research in theory and practical implementation
of network protocols: [R]ARP, DNS, IPv4 IPv6, ICMP, GMP, OSPF, RIP,
TCP, UDP, and SNMP. Vast experience in web development (CMF, CRM,
ERP), web languages, HTML, Python, PHP, XML, CSS, MySQL, Postgres,
Gadfly, and SQLite.
Network Security and Forensics Investigation:
Extensive experience with AIX, BSD(i), IRIX, HPUX, Linux, SCO, Solaris,
Snort Intrusion Detection Systems. Configuration and Management of
Checkpoint, IPF, OpenBSD PF, IPtables, Cisco (ASA, ASAFWSM,
ASASM) and Raptor Firewalls. He has extensive technical writing
experience, documenting many Operating Systems in a threatened scenario,
extensive forensics analysis and assessment experience of enterprise
environments, investigative procedures and documentation.
Website Backend Development
Responsive Web Tool Development
Content Management Systems
WordPress Theme Integration
Drupal Theme Integration
Mobile Platform Development
Usability Testing
Django Python Integration
Python Development
Content Management Framework Creation
Analytics
Social Media
Embedded Systems Development
ADC Systems Development
In his spare time he writes web applications for small contracts, geeks out on
new technologies, and designs gambling software.
1 Introduction
1.1 Introduction
The Python programming community is rapidly growing. More people are
either migrating to python or choosing it as their first high level programming
language. It's multiple programming paradigms feature make it an easier first
language to learn, because it frees you from focusing on the language itself,
and more on problem solving. Python is highly portable for multiple
operating systems, including embedded systems. It's also ``Open Source'' and
can be distributed freely.
This book can be used for the experienced programmer, or absolute beginner.
The complexity of the language gradually progresses, but the concepts will
remain simple and easy to understand. Readers are not restricted to any
previous specific concept. All concepts and examples can be easily modified
and re-used. You will be able to play with the advanced features of python
quickly.
The job market is putting a higher demand for fast turnaround on
development for new products. It's also becoming a heavy hitter in the game
market for its use throughout the game development cycle such as rendering,
parsing, statistics and core development. Python can be easily extended using
C/C++ for speed and performance. It's used extensively in Academia for
Science, Math, Engineering, simulations, and other computation experiments.
Python's greatest selling point is the vast libraries of pre-written tools. Below
is a highlight of tools which comprises approximately 10% of what actually
exists.
Integrated Development Environments - Boa Constructor, a cross-
platform IDE for Python - EasyEclipse, an open source IDE for Python
and other languages.
Applications - BitTorrent original client, as well as other derivatives -
Gajim, an Instant Message client - Resolver One, a spreadsheet.
Web Applications - A feed Aggregator (Planet), a user-friendly
Content Management System (Plone), a bug tracking system
(Roundup).
Video games - Civilization 4 uses python for most of its tasks, Eve
“online” uses Stackless Python. PyGame has tons of games written in
pure python.
Web frameworks - CherryPy an object-oriented web application server
and framework, Django an MVC (Model, View, Controller) web
framework, Zope is an application server commonly used to build
content management systems.
Graphics frameworks - Pygame has python bindings for Simple
DirectMedia Layer (SDL), Pyglet is a cross-platform windowing and
multimedia library for Python, PIL (Python Imaging Library) a module
for working with images, Soya 3D is a high-level 3D game engine for
Python.
GUI frameworks - PyGTK is a popular cross-platform GUI library
using GTK+, PyQt is another cross-platform GUI library using Qt,
wxPython is a port of wxWidgets and a cross-platform GUI library for
Python.
Scientific packages - BioPython, a Python molecular biology suite.
SciPy is a library of scientific and numerical routines.
Mathematical libraries - matplotlib, an extension providing
MATLAB-like plotting and mathematical functions. NumPy is a
language extension that adds support for large and fast, multi-
dimensional arrays and matrices.
Additional development packages - Cheetah, a Python-powered
template engine and code-generation tool, mod python is an Apache
module allowing direct integration of Python scripts with the Apache
web server, Twisted is a networking framework for Python
Embedded as a scripting language - GIMP- (Graphics Image
Manipulation Program) , Blender, 3d graphics program , Inkscape is a
Graphics program , Poser is a 3D rendering and animation software
program that uses PoserPython tool-set.
Commercial uses - Google uses Python for many tasks including the
Backends of web App's, Maya is a professional 3D modeler, NASA is
using Python to implement a CAD/CAE/PDM repository and model
management, integration, and transformation system.
Python implementations - IronPython, Python for .NET and Mono
platforms - Jython, Python coded in Java - Stackless Python, Python
with co-routines.
What makes this book unique is the transition from beginner to intermediate
programming. The transition will occur several times throughout the book,
when introducing a new topic such as web applications and GUI. You will
revisit beginning aspects of programming to simplify learning a new module,
instead of assuming you are already proficient in the previous techniques
discussed. Most importantly you will be instructed in the ability to convert
code to other programming styles and technique; this will make it easy to
adopt any style or method when re-using reusable code. Python also has an
enhancement program known as PEP (Python Enhancement Program), which
contains an index of potential proposals to further enhance the python
programming language. Python is evolving towards 3.x which includes minor
changes with regards to backwards compatibility. A chapter at the end of the
book will be devoted to compatibility changes and migration.
1.1.1 History
Python was created in the late 1980s by Guido van Rossum at CWI in the
Netherlands and was a successor to the ABC programming language. Python
was re-designed to be a multi-paradigm programming language making it
possible for programmers to adopt multiple styles of programming such as
object-oriented programming, structured, functional, aspect-oriented
programming and meta programming.
1.1.2 Installation
It is highly recommended that you use Linux as your primary platform to
learn and use python. However you are not restricted. Nearly everything can
be done in Microsoft Windows™ or Apple Macintosh™ with few troubles.
1.1.3 Windows
Visit http://www.python.org/download and you will find an installer for
windows. Select all installation components.
If you wish to use Python in Microsoft Windows™ on the command line,
then you need to set the PATH variable appropriately.
For Windows™ 2000, XP, 2003, Vista, 2008, etc... click on Control Panel ->
System -> Advanced -> Environment variables. Click on the variable named
PATH in the “System Variables” section, then select:
Edit and add; C:\Python27 to the end of the line.
Please choose proper directory name. For instance: it could be C:\Python2.7x
1.1.4 Linux
Most Linux distributions come with Python installed by default. However
you may need to install additional packages such as the documentation. For
example, Knoppix or Debian run the following:
sudo apt-get install python27-doc
By selecting the defaults, you will have installed python core files including
documentation, such as, interactive help and manual pages.
You can verify the version of python via the command line using “python –
V” as shown below.
$ python –V
Python 2.7.9
1.1.5 Editors
Choosing an editor can be very crucial for the successful development of
your scripts. You have to be completely comfortable with your editor and
have full knowledge of how it writes files. For instance, scripts written on
Microsoft Windows™ Notepad can have several issues when you port the
files to a Linux or BSD operating system. Those files might have carriage
return issues Control-M (^M) on each statement. You would have to
manually remove them on each statement or do a file wide search and replace
which can be tricky because you need an escape code to find it. The escape
code is (x0D) or (\x0D). However you can avoid these issues by using a
compatible editor.
1.1.6 Case Sensitive
You might have noticed Microsoft Windows™ is not case sensitive.
However, on a Unix variant operating system or Linux, you will need to be
more specific when executing scripts. For example, typing “python” at the
command prompt would list the following:
Note: To exit out of the interpreter press "Ctrl-D" followed by enter or type
“exit()”.
$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
If you are using python in iOS, Apple accepts the uppercase “Python”, and
you will not see an error.
1.1.7 Additional Packages
You will learn how to download the following packages in later chapters as
you need them:
python-doc - Documentation for the high-level object-oriented-
programming.
python-docutils - Utilities for the documentation of Python.
python2.7-doc - Documentation for the high-level object-oriented
language.
python-django - A high-level Python Web framework python-gtk2 -
Python bindings for the GTK+ widget sets.
python-sqlite - Python interface to SQLite 2 (currently included as of
2.6).
python-tk - Tkinter - Writing Tk applications with Python python-
pygame, and writing game applications using Python2.7x.
python-wxWidgets – Writing Wx applications with Python.
zope3 – Web application framework.
1.1.8 Versions
At the beginning of this project all applications were compiled using python
version 2.7. Before completion of this project all applications were compiled
and tested with Python version 2.8. The code will work in Python 3.x with
minor changes such as: print statement. Almost everything here is backwards
compatible and will translate easily into Python 3 if you familiarize yourself
with the minor syntactical changes. Don't let the version of python distract
you. The changes are often very minor. See the two following examples
below:
Python 2.2x is: print variable.
Python 3.x is: print(variable)
* Please visit http://www.wiki.python.org/moin/Python2orPython3
1.1.9 Installation and Configuration
It is highly recommended that you choose an Operating System that you are
proficient using. It is assumed that you have a clear understanding of your
Operating System and how to execute programs via command line.
1.1.10 Python Interactive Prompt
For Microsoft Windows™users, Python interactive interpreter can be
executed via the DOS prompt or through the “IDLE”. (Interactive
Development Environment) program.
To start the interactive interpreter enter "python" at the command or shell
prompt in Windows or xterm in Linux or Terminal in iOS.
The following information should appear:
knoppix@Microknoppix:~$ python
Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26)[GCC 4.3.2]
on linux2 Type "help", "copyright", "credits" or "license"
for more information.
>>>
Please note that python is case sensitive. Print will give you an invalid syntax
error.
>>> Print 'hello'
File "<stdin>", line 1
Print 'hello'
^
SyntaxError: invalid syntax
>>>
A proper script would include the path to the interpreter, a description, the
name of the file and other files that might be involved. The path to the
interpreter is not needed while using python on a windows™ operating
system.
#!/usr/bin/python
# program name first.py
print 'I am learning python'
Edit the file with the information in the figure above, then Save and Close the
file. If you are on a Linux system, you will need to change the file
permissions to make it an executable program.
knoppix@Microknoppix:~$ chmod a+x fist.py
Notice the #! hash or number symbol and exclamation. It's known in Unix or
Linux as “explode” and “bang” or “sha-bang” which is the key to execute the
shell or interpreter. Anything after the first line is considered either code or
comments. Comments are designated using the hash (#) symbol. On
Windows™ the path to the Python interpreter will be, for example,
c:\python27.x\python.exe. You can also omit (#!) on first line.
Python's built-in interpreter also has a nice interactive feature known as
help(). To start the interactive interpreter enter "python" at the command or
shell prompt:
knoppix@Microknoppix:~$ python
Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26) [GCC 4.3.2] on
linux2 Type "help", "copyright", "credits" or "license"
for more information.
>>> help()
Welcome to Python 2.7! This is the online help utility.
If this is your first time using Python, you should definitely
check out the tutorial on the Internet at
http://www.python.org/doc/tut/.
Enter the name of any module, keyword, or topic to get help on
writing Python programs and using Python modules. To quit
this help utility and return to the interpreter, just type "quit".
To get a list of available modules, keywords, or topics, type
"modules", "keywords", or "topics". Each module also comes
with a one-line summary of what it does; to list the modules
whose summaries contain a given word such as "spam", type
"modules spam".
help>
To exit out of help mode type 'q' and it will put you back into the interpreter
mode >>>. With this interactive help you can learn about almost anything in
Python, for example:
>>> help('str')
1.1.12 Summary
In this chapter you have learned how to use the interactive interpreter, how to
create and execute scripts, and how to activate the interactive help module.
1.1.13 Exercises
1. Go through the examples above using the interactive interpreter.
2. Create a script to print out a list of all modules and redirect that list to a
file called “python-modules.txt”.
3. Create another script to print the print module and redirect to file called
“python-print.txt”.
Double Quotes
Your scripts might look a little better if you swap between single and double
quotes as needed.
>>> print "It's your python"
It's your python
We can create the string but we really don't have to do anything with it. The
interpreter will tell you what it is. Next enter the following into the
interpreter. (Make sure to enter 3 single quotes before and after). Warning a
double quote and single quote together will give a different error.
>>> '''line 1
... line 2'''
'line 1\nline 2'
Notice the (\n) for new line. Try it with print in front of it and it will put the
string in two separate lines.
>>> print '''line 1
... line 2'''
line 1
line 2
If you enter “\n” the following string will be displayed on a new line..
>>> print 'I\ngo'
I
go
The results will be the same with >>>”””. Now a raw string with some slight
changes. Try it at the interpreter.
>>> r'string'
'string'
>>> r'string\string2'
'string\\string2'
>>> r"string\string2"
'string\\string2'
>>> print r"string\string2"
string\string2
>>> r"""string\string2"""
'string\\string2'
>>> print r"""string\string2"""
string\string2
The last example is to show that you can test your expressions as your scripts
progress towards complexity in the future. The string examples above will
become more evident as you progress. In section 3.2.3 there is an example of
printing a string, integer, or float in a print statement on the same line.
2.0.15 Variables and Assignment
Assignments must begin with either an (upper or lower case) letter or an
underscore (_). A number can be used after the first letter or underscore. Here
are some examples. Please try each one to get a feel for the effect.
>>> var1=1
>>> print var1
1
>>> a=2
>>> print a
2
>>> b,c=3,4
>>> print b,c
34
>>> s= 'string'
>>> print s
string
>>> s
'string'
Notice that in the equation 2+3*8, multiplication comes before addition. You
can change this around by using parenthesis (2+3)*8 gives 40. Also notice
2/3 gives 0. Since it's an integer it returns the appropriate integer. If you
know that the expression yields a decimal place, then supply it to begin with,
otherwise you will corrupt your output.
2.0.17 Pitfalls
You may have noticed with the above examples that you can run into many
pitfalls. Truncation, and conversion are the primary causes of corruption.
Always test your work first before deployment.
2.0.18 Integer Conversion
>>> number=1234
>>> int(number)
1234
>>> int(12.34)
12
>>> round(12.34)
12.0
>>>oct(number)
'02322'
>>> hex(number)
'0x4d2'
>>> print 2**256
11579208923731619542357098500868790785326998466564
0564039457584007913129639936
>>> x=1234567890
>>> y=3489493838
>>> x+y
4724061728L
>>> x*x
1524157875019052100L
>>> x*y
4308017044747661820L
As you can see, “python” supports large integers out of the box. However
you might see the “L” statement as listed in above examples. This really
depends on the operating system.
2.1 Conditions and Indentation
2.1.1 Flow Control if/else
help(“if”)
The if statement is used for conditional execution: Please DO NOT type the
following.
if_stmt ::= "if" expression ":" suite
( "elif" expression ":" suite )*
["else" ":" suite]
2.1.4 Examples
Now we can learn a little about flow and conditions. You can utilize the
interactive interpreter, but keep in mind that if you exit out early and connect
back later, you will need to reinitialize x=3 again to test out the conditions.
The preferred way would be to enter this into a file called “conditions.py”.
Using your favorite editor, run it using the following command: “python
./conditions.py”.
Pay ATTENTION to indentation!
x=3
if x < 4:
print "x is less then 4 x is ",x
if (x < 4 or x > 2):
print "x is less then 4 and greater than 2, x=", x
if x == 1:
print "Item 1 - true value", x
elif x == 2:
print "Item 2 - true value", x
elif x == 3:
print "Item 3 - true value", x
else:
print "Default option if none listed", x
for i in [1,2,3,4,5,6,7,8,9,10]:
print "Iteration #", i
for i in range(5):
print i # note this prints up to 4
while (x< 10):
print "The while iteration is.", x
x=x+1
Indentation can be either a space or a tab. Whichever you choose will set the
level for the rest of the script. After you run “conditions.py” feel free to edit it
and change the values. You can remove the indentation and read the errors.
With what you have learned you can compute just about any algorithm. Of
course input functions, and methods would round out your knowledge and
can be found in the next chapter.
2.1.5 Conditions and Indentation
You can utilize the interactive interpreter or continue to use your favorite
editor. Enter the following data into a file called “conditions.py”.
Pay ATTENTION to indentation!
x=3
if x < 4:
print "x is less then 4 x is ",x # notice the space (is ",x)
if (x < 4 or x > 2):
print "x is less then 4 and greater then 2, x=", x # notice (x=", x)
if x == 1:
print "Item 1 - true value", x
elif x == 2:
print "Item 2 - true value", x
elif x == 3:
print "Item 3 - true value", x
else:
print "Default option if none listed", x
Standard iteration:
for i in [1,2,3,4,5]:
print "Iteration #", i
results:
Iteration # 1
Iteration # 2
Iteration # 3
Iteration # 4
Iteration # 5
Iterate a range:
for i in range(5):
print i # note this prints up to 4
results:
0
1
2
3
4
Notice that it went from 0 to 4. You can change where it starts by setting an
additional parameter range(1,5) so it will start with 1 and end with 4.
while (x< 10):
print "The while iteration is.", x
x=x+1
Notice that indention is very important and can be either a space or tab.
Whichever you choose first sets the key or level for the rest of the script.
Please change some of the values in the “conditions.py” to get different
results.
2.1.6 Summary
In this chapter you will have learned how strings work, and how to supply a
number or string to a variable and operators. With what you have learned so
far you can compute just about any algorithm. However things would be
easier if functions (methods) are used. This will be discussed in later
chapters.
2.1.7 Exercises
Figure 0.1:
Formula Temperature
formula for Celsius to Fahrenheit c* (9 /5) +32=x
python code for this would be as simple as (c*9/5+32)
As you can see 'd' is not defined and so it crashes! What if 'd' was defined in
the code? Create a new file with the following as save as 'input-hack.py'.
#input-hack.py
d=5
x = input("Enter a number: ")
print "The square of number is ", x*x
When you run the program you can now enter any number, and when you
enter the letter 'd' it's already defined and should return 25. The 'input()'
function is very dangerous, because it uses 'raw_input' and converts the data
to a number using 'eval()'. Run the program again and type 2+2. It should
return 16.
If you change the code from 'x*x' to 'x+x', and run the script again with
'raw_input()' like in the next example. The string of your choice will be
duplicated twice. This is a warning to advise you not to use 'input()' as it can
create inconsistencies in the results as well as an opportunity to hack the
code.
3.1.2 raw_input()
Let's create another file 'rawinput.py'
#rawinput.py
x = raw_input("Enter a number or string: ")
print "you entered ", x
Please test the results and you will notice greater consistency. Further
improvements can be made by reviewing the errors, substitute 'x' with 'x*x'
and you will get an ( 'TypeError': can't multiply sequence by non-int of type
('str') when you enter a number.
3.1.2.1 Guess Program
#guess.py
number = 10
guess = int(raw_input('Enter a number between 1 & 20: '))
if guess == number:
print 'Congrats! Correct number is', number
elif guess < number:
print 'No, try a little higher'
else:
print 'No, try a little lower'
The guess program has 'raw_input' wrapped to an integer called 'int'. So the
string is converted to an integer after you enter the number and hit return. If
you change the 'raw_input()' to guess = raw_input("Enter an integer
between 1 and 20: '). The 'if else' statement will try to process the string, and
default to the last else statement.
You can wrap this code with a while statement as follows:
#whileguess.py
number=10
while True:
guess = int(raw_input('Enter a number between 1 & 20: '))
if guess == number:
print 'Congrats! Correct number is', number
break
elif guess < number:
print 'No, try a little higher'
else:
print 'No, try a little lower'
Notice I added the break statement if the value is true it exits out of the loop.
3.1.3 Declare a Function
The most common function to declare is a simple 'hello' statement.
#hello.py
def hello():
print "Hello"
return
hello()
You call the function with 'hello()'. A more practical function would be to
process the square of a number.
def square(x):
return x*x
print square(2) # call the function
This is also a mild example of local vs global where the square is local to
the function. The input is global.
3.1.4 Functions with Parameters
#function with parameter
#functionpar.py
def areaSquare(a,b):
return a*b
print areaSquare(2,3)
z=4
y=2
print areaSquare(z,y)
Here is another way to write this that might be easier for others to follow.
#functionarg.py
def tableLeaf(a,b=5):
print "area of table:", a*b
tableLeaf(5,10)
tableLeaf(5)
You can expand this by adding another 'raw_input' and assign it to 'y'. Then
call 'tableLeaf(x,y)'.
3.2.2 help(tuple)
Tuples are similar to lists except they are immutable like strings. You would
use them when you are sure that they will not change.
#mytuple.py
mytuple = ('pen', 'pencils', 'paper')
print 'mytuple contains: ',mytuple
print 'I have',len(mytuple), 'in mytuple'
drawer = ('ruler', 'paperclips', mytuple)
print 'mytuple and drawer contain: ',drawer
print 'first item in first tuple is : ',drawer[2][0]
3.2.4 Dictionary
help('dict')
A dictionary is like an address book. This example will use an inventory
system.
#inventory.py
inv = {'monitors': 'two', 'printers': 5, 'keyboards':3}
print inv["printers"]
inv['printers'] = 6
print inv['printers']
print inv
del inv['keyboards']
print inv
for i,j in inv.iteritems():
print i, j
3.2.5 Sequence
The main feature of sequence is the ability to access the item in the index
directly or to slice them.
#seq.py
x = ["monitor","keyboard","cpu","printer","mouse","paper",
"cables","laptops"]
print x[0]
print x[0:1]
print x[2:5]
print x[:4]
print x[4:]
print x[-4]
3.3 Modules
Python comes with a large library of modules that can be used for all sorts of
tasks from database programming, web programming, to graphics and games.
A module is a file that contains functions and variables defined for reuse.
One of the first modules used was the string module that has a series of
functions designed to manipulate strings. To use the module you import it as
follows:
import string
Of course string is a standard library. You can build and save functions in
another file and load them using import. Make sure the file you import has a
'py' extension. For example these two files:
#hellomodule.py
def hello():
print "hello"
So now you get the idea that the first field in the list is the script name itself.
A loop can easily cycle through the list.
# arg.py
import sys
for i in sys.argv:
print i
Run the following code above: python ./arg2.py arg1 arg2 hello
As you see it's using a 'greater than 1' operator. There is always at least one
item in the list which is the file itself. You need to separate the file name
from the arguments. To do this, you will need to use -1.
3.3.2 Practical Usage:
Here is a practical example. Pay ATTENTION to indentation!
# square.py
import sys
def square(x):
return x*x
x = int(sys.argv[1])
print 'square is %g' % square(x)
Run the program as follows: 'python ./square.py 4 ' and it should return 16.
However if you run it without an argument it will error. To fix you can easily
add the 'if' statement below to the file above the function 'def square(x):'. No
need to add the 'else' label as it is already implicit.
#square1.py
import sys
def square(x):
return x*x
if len(sys.argv) !=2:
print 'Need an integer'
sys.exit(1)
x = int(sys.argv[1])
print 'square is %g' % square(x)
As you can see when the file is imported, the 'else' statement prints since it is
not loaded directly. A more practical method would be:
# fmodtest.py
def square(x):
return x*x
if __name__ == '__main__':
print "testing square(4) directly", square(4)
If you run it directly, it should print out 16. Next, let's build another file and
import it as follows:
# testmodf.py
import fmodtest
print "from import square(16)", fmodtest.square(16)
Notice this will only print the modules function 'def square(x)' from
'amodtest.py' and nothing after.
3.3.5 Summary
At this point you can build any algorithm you want. Having the ability to
create your own functions gives you the power to create custom algorithms
without importing additional libraries.
3.3.6 Exercises
1. Go through the examples above using the interactive interpreter.
2. Convert 'whileguess.py' into a function and call it 'guess()'.
3. Create a function to calculate Celsius and convert to Fahrenheit upon
user input. Use a while loop to process the temperature until user enters
'x' to exit.
4. Using the following list (list="I will master strings"). Use a for loop to
print the word 'master'.
4 Files
4.1 File
Working with files made simple.
4.1.1 The Basics
simple open example:
>>> blah=open("data.txt", 'w')
>>> blah.write("I am learning python\nI love python\nPython is great")
>>> blah.close()
>>>
Results:
['I am learning python\n', 'I love python\n', 'python is great\n', '\n']
results:
I
a
m
l
e
a
r
n
...
Here is something to remember: 'list = blah. read()' does the same except
output is on separate lines. Try it out with the script above and review the
differences.
#!/usr/bin/python
# file2.py
blah = open("data.txt", "r")
list = blah.readlines()
for i in list:
print i
blah.close()
results:
I am learning python
I love python
python is great
results:
learning python
Results:
print specific line 'love' in file
I love python
print specific list in file as a list
['I', 'love', 'python']
print specific field in list 'love'
love
search for specific field in list 'python' to print
python
The above example demonstrates the ability to only print a specific instance
on a specific line of a file even if there might be more than one instance of
the word 'python' in the file.
4.1.4 Binary Files
simple open binary file:
>>> blahbin = open ( 'binary.txt', 'wb' )
>>> blahbin.write ( 'write binary data.' )
>>> blahbin.close()
>>>
>>> blahbin = open ( 'binary.txt', 'rb' )
>>> print blahbin.read()
>>> blahbin.close()
>>>
4.1.5 Pickle
help('pickle')
Now that we can read and write string, what about lists, tuples, and
dictionaries?
4.1.6 Let's Pickle
'Pickle' is used with databases and a few other python frameworks to assist
with persistent data manipulation.
#!/usr/bin/python
#apickle.py
import pickle
filePickle = open ( 'pickleFile.txt', 'w' )
list = [ 'I', 'love', 'python', 1,2,3, 'ok' ]
list2 = { 'firstname': 'john', 'lastname': 'doe', 1: 'one'}
pickle.dump ( list, filePickle)
pickle.dump ( list2, filePickle)
filePickle.close()
Now look at the contents of the 'pickleFile.txt'. Open it up and take a look
inside the file with your editor:
(lp0
S'I'
p1
aS'love'
p2
aS'python'
p3
aI1
aI2
aI3
aS'ok'
...
results:
I
love
python
1
2
3
ok
...
4.1.7 cPickle
A faster version of pickle is 'cPickle' which is a 'C' compiled version of
pickle. This can be easily imported as follows:
import cPickle as pickle
Here is an example its essentially the same but while using idle you get a
different effect using 'test1' or 'print test1':
>>>import cPickle as pickle
>>>
>>> test1 = ('I love python', 1, [1, 2, 3] )
>>> test1
('I love python', 1, [1, 2, 3])
>>>
>>> part1 = pickle.dumps(test1)
>>> part1
"(S'I love python'\nI1\n(lp1\nI1\naI2\naI3\natp2\n."
>>>
>>> print part1
(S'I love python'
I1
(lp1
I1
aI2
aI3
atp2
.
>>>
The expression is evaluated, and it should result in an object that supports the
context management protocol '__enter__()' and '__exit__()' methods.
Let's write data to a file:
with open('output.txt', 'w') as f:
f.write(“Usual Hello World!”)
The above 'with' statement will automatically close the file after nested block
of code.
4.1.8.1 File Handling Modes
Table 0.1:
File Modes
Modes Description
r Opens file for reading only
rb Opens file for reading binary only
r+ Opens file for both reading and writing
rb+ Opens binary file for reading and writing
w Opens file for writing only
wb Opens binary file for writing only
a Opens a file for appending
ab Opens a binary file for appending
a+ Opens a file for both appending and
reading
ab+ Opens a file for both appending and
reading in binary
4.1.8.2 File A ttributes
Table 0.3:
File Attributes
Attribute Description
file.closed Returns true if closed
file.mode Returns access mode of opened file
file.name Returns the name of the file
file.softspace Returns false if space explicitly required with
print, otherwise true.
Example below:
#!/usr/bin/python
#filetest.py
f = open("dat.txt", "wb")
print "Name the file: ", f.name
print "Closed or open: ", f.closed
print "mode: ", f.mode
print "Softspace: ", f.softspace
Also note you did not need 'dat.txt' to run this script.
Results:
Name the file: dat.txt
Closed or open: False
mode: wb
Softspace: 0
Please note you didn't need to use 8 bits. My example above has 7 bits.
However it took 1001 for the first value of 9 in the 1's place and the next 001
for 10's place making 19.
Conversion to Character requires an 8 bit maximum string.
>>> print chr(int('1111001',2))
y
>>> print chr(int('1111011',2))
{
python 3 supports binary literal by adding b'01011' before the string to denote
binary string.
The following is an example of bin(),oct(),and hex() conversion
>>> x=123
>>> bin(x)
'0b1111011'
Notice the literal 'b' encoded in the string representation. Literal data types
are available in python3.0 or by importing future library
>>> oct(x)
Exploring the Variety of Random
Documents with Different Content
But I began this letter, not for what I have been writing, but to say
something on that subject which you know to be of such infinite
solicitude to me. The immense sufferings you endured from the first
days of September till the middle of February you never tried to
conceal from me, and I well understood. You have now been the
husband of a lovely woman nearly eight months. That you are
happier now than the day you married her, I well know; for without
you could not be living. But I have your word for it, too, and the
returning elasticity of spirits which is manifested in your letters. But I
want to ask a close question, "Are you now in feeling, as well as
judgment, glad you are married as you are?" From anybody but me
this would be an impudent question, not to be tolerated; but I know
you will pardon it in me. Please answer it quickly, as I am impatient
to know.
I have sent my love to your Fanny so often, I fear she is getting
tired of it. However, I venture to tender it again,
Yours forever,
Lincoln.
In the last of these letters, Mr. Lincoln refers to his "duel with
Shields." That was another of the disagreeable consequences which
flowed from his fatal entanglement with Mary. Not content with
managing a timid, although half-frantic and refractory, lover, her
restless spirit led her into new fields of adventure. Her pen was too
keen to be idle in the political controversies of the time. As a satirical
writer, she had no rival of either sex at Springfield, and few, we
venture to say, anywhere else. But that is a dangerous talent: the
temptations to use it unfairly are numerous and strong; it inflicts so
much pain, and almost necessarily so much injustice, upon those
against whom it is directed, that its possessor rarely, if ever, escapes
from a controversy without suffering from the desperation it
provokes. Mary Todd was not disposed to let her genius rust for
want of use; and, finding no other victim handy, she turned her
attention to James Shields, "Auditor." She had a friend, one Miss
Jayne, afterwards Mrs. Trumbull, who helped to keep her literary
secrets, and assisted as much as she could in worrying the choleric
Irishman. Mr. Francis, the editor, knew very well that Shields was "a
fighting-man;" but the "pieces" sent him by the wicked ladies were
so uncommonly rich in point and humor, that he yielded to a natural
inclination, and printed them, one and all. Below we give a few
specimens:—
LETTER FROM THE LOST TOWNSHIPS.
Lost Townships, Aug. 27, 1842.
Dear Mr. Printer,—I see you printed that long letter I sent you a
spell ago: I'm quite encouraged by it, and can't keep from writing
again. I think the printing of my letters will be a good thing all
round,—it will give me the benefit of being known by the world, and
give the world the advantage of knowing what's going on in the Lost
Townships, and give your paper respectability besides. So here
comes another. Yesterday afternoon I hurried through cleaning up
the dinner-dishes, and stepped over to Neighbor S——, to see if his
wife Peggy was as well as mought be expected, and hear what they
called the baby. Well, when I got there, and just turned round the
corner of his log-cabin, there he was setting on the doorstep reading
a newspaper.
"How are you, Jeff?" says I. He sorter started when he heard me,
for he hadn't seen me before.
"Why," says he, "I'm mad as the devil, Aunt'Becca!"
"What about?" says I: "ain't its hair the right color? None of that
nonsense, Jeff: there ain't an honester woman in the Lost Townships
than"—
"Than who?" says he: "what the mischief are you about?"
I began to see I was running the wrong trail, and so says I, "Oh!
nothing: I guess I was mistaken a little, that's all. But what is it
you're mad about?" "Why," says he, "I've been tugging ever since
harvest getting out wheat and hauling it to the river, to raise State-
Bank paper enough to pay my tax this year, and a little school-debt I
owe; and now, just as I've got it, here I open this infernal 'Extra
Register,' expecting to find it full of 'Glorious Democratic Victories'
and 'High-Comb'd Cocks,' when, lo and behold! I find a set of fellows
calling themselves officers of State have forbidden the tax-collectors
and school-commissioners to receive State paper at all; and so here
it is, dead on my hands. I don't now believe all the plunder I've got
will fetch ready cash enough to pay my taxes and that school-debt."
I was a good deal thunderstruck myself; for that was the first I
had heard of the proclamation, and my old man was pretty much in
the same fix with Jeff. We both stood a moment staring at one
another, without knowing what to say. At last says I, "Mr. S———, let
me look at that paper." He handed it to me, when I read the
proclamation over.
"There, now," says he, "did you ever see such a piece of
impudence and imposition as that?" I saw Jeff was in a good tune
for saying some ill-natured things, and so I tho't I would just argue a
little on the contrary side, and make him rant a spell if I could.
"Why," says I, looking as dignified and thoughtful as I could, "it
seems pretty tough, to be sure, to have to raise silver where there's
none to be raised; but then, you see, 'there will be danger of loss' if
it ain't done."
"Loss, damnation 1" says he. "I defy Daniel Webster, I defy King
Solomon, I defy the world,—I defy—I defy—yes, I defy even you,
Aunt'Becca, to show how the people can lose any thing by paying
their taxes in State paper."
"Well," says I, "you see what the officers of State say about it, and
they are a desarnin' set of men. But," says I, "I guess you're
mistaken about what the proclamation says. It don't say the people
will lose any thing by the paper money being taken for taxes. It only
says 'there will be danger of loss;' and though it is tolerable plain
that the people can't lose by paying their taxes in something they
can get easier than silver, instead of having to pay silver; and though
it is just as plain that the State can't lose by taking State-Bank paper,
however low it may be, while she owes the bank more than the
whole revenue, and can pay that paper over on her debt, dollar for
dollar,—still there is danger of loss to the 'officers of State;' and you
know, Jeff, we can't get along without officers of State."
"Damn officers of State!" says he: "that's what you Whigs are
always hurrahing for."
"Now, don't swear so, Jeff," says I: "you know I belong to the
meetin', and swearin' hurts my feelins'."
"Beg pardon, Aunt'Becca," says he; "but I do say it's enough to
make Dr. Goddard swear, to have tax to pay in silver, for nothing
only that Ford may get his two thousand a year, and Shields his
twenty-four hundred a year, and Carpenter his sixteen hundred a
year, and all without 'danger of loss' by taking it in State paper. Yes,
yes: it's plain enough now what these officers of State mean by
'danger of loss.' Wash, I s'pose, actually lost fifteen hundred dollars
out of the three thousand that two of these 'officers of State' let him
steal from the treasury, by being compelled to take it in State paper.
Wonder if we don't have a proclamation before long commanding us
to make up this loss to Wash in silver."
And so he went on till his breath run out, and he had to stop. I
couldn't think of any thing to say just then; and so I begun to look
over the paper again. "Ay! here's another proclamation, or
something like it."
"Another!" says Jeff; "and whose egg is it, pray?"
I looked to the bottom of it, and read aloud, "Your obedient
servant, Jas. Shields, Auditor."
"Aha!" says Jeff, "one of them same three fellows again. Well,
read it, and let's hear what of it."
I read on till I came to where it says, "The object of this measure
is to suspend the collection of the revenue for the current year."
"Now stop, now stop!" says he: "that's a lie a'ready, and I don't
want to hear of it."
"Oh! maybe not," says I.
"I say it—is—a—lie. Suspend the collection, indeed! Will the
collectors, that have taken their oaths to make the collection, dare to
suspend it? Is there any thing in the law requiring them to perjure
themselves at the bidding of James Shields? Will the greedy gullet of
the penitentiary be satisfied with swallowing him instead of all them,
if they should venture to obey him? And would he not discover some
'danger of loss,' and be off, about the time it came to taking their
places?
"And suppose the people attempt to suspend, by refusing to pay,
what then? The collectors would just jerk up their horses and cows,
and the like, and sell them to the highest bidder for silver in hand,
without valuation or redemption. Why, Shields didn't believe that
story himself: it was never meant for the truth. If it was true, why
was it not writ till five days after the proclamation? Why didn't Carlin
and Carpenter sign it as well as Shields? Answer me that,
Aunt'Becca. I say it's a lie, and not a well-told one at that. It grins
out like a copper dollar. Shields is a fool as well as a liar. With him
truth is out of the question; and, as for getting a good bright
passable lie out of him, you might as well try to strike fire from a
cake of tallow. I stick to it, it's all an infernal Whig lie!"
"A Whig lie! Highty tighty!"
"Yes, a Whig lie; and it's just like every thing the cursed British
Whigs do. First they'll do some divilment, and then they'll tell a lie to
hide it. And they don't care how plain a lie it is: they think they can
cram any sort of a one down the throats of the ignorant Locofocos,
as they call the Democrats."
"Why, Jeff, you're crazy: you don't mean to say Shields is a Whig!"
"Yes, I do."
"Why, look here! the proclamation is in your own Democratic
paper, as you call it."
"I know it; and what of that? They only printed it to let us
Democrats see the deviltry the Whigs are at."
"Well, but Shields is the auditor of this Loco—I mean this
Democratic State."
"So he is, and Tyler appointed him to office."
"Tyler appointed him?"
"Yes (if you must chaw it over), Tyler appointed him; or, if it
wasn't him, it was old Granny Harrison, and that's all one. I tell you,
Aunt'Becca, there's no mistake about his being a Whig. Why, his very
looks shows it,—every thing about him shows it: if I was deaf and
blind, I could tell him by the smell. I seed him when I was down in
Springfield last winter. They had a sort of a gatherin' there one night
among the grandees, they called a fair. All the gals about town was
there; and all the handsome widows and married women, finickin'
about, trying to look like gals, tied as tight in the middle, and puffed
out at both ends, like bundles of fodder that hadn't been stacked
yet, but wanted stackin' pretty bad. And then they had tables all
round the house kivered over with [ ] caps, and pincushions, and ten
thousand such little knick-knacks, tryin' to sell'em to the fellows that
were bowin' and scrapin' and kungeerin' about'em. They wouldn't let
no Democrats in, for fear they'd disgust the ladies, or scare the little
gals, or dirty the floor. I looked in at the window, and there was this
same fellow Shields floatin' about on the air, without heft or earthly
substance, just like a lock of cat-fur where cats had been fightin'.
"He was paying his money to this one, and that one, and t'other
one, and sufferin' great loss because it wasn't silver instead of State
paper; and the sweet distress he seemed to be in,—his very
features, in the ecstatic agony of his soul, spoke audibly and
distinctly, 'Dear girls, it is distressing, but I cannot marry you all. Too
well I know how much you suffer; but do, do remember, it is not my
fault that I am so handsome and so interesting.'
"As this last was expressed by a most exquisite contortion of his
face, he seized hold of one of their hands, and squeezed, and held
on to it about a quarter of an hour. 'O my good fellow!' says I to
myself, 'if that was one of our Democratic gals in the Lost
Townships, the way you'd get a brass pin let into you, would be
about up to the head.' He a Democrat! Fiddlesticks! I tell you,
Aunt'Becca, he's a Whig, and no mistake: nobody but a Whig could
make such a conceity dunce of himself."
"Well," says I, "maybe he is; but, if he is, I'm mistaken the worst
sort. Maybe so, maybe so; but, if I am, I'll suffer by it; I'll be a
Democrat if it turns out that Shields is a Whig; considerin' you shall
be a Whig if he turns out a Democrat."
"A bargain, by jingoes!" says he; "but how will we find out?"
"Why," says I, "we'll just write, and ax the printer."
"Agreed again!" says he; "and, by thunder! if it does turn out that
Shields is a Democrat, I never will"—
"Jefferson,—Jefferson"—
"What do you want, Peggy?"
"Do get through your everlasting clatter sometime, and bring me a
gourd of water: the child's been crying for a drink this live-long
hour."
"Let it die, then: it may as well die for water as to be taxed to
death to fatten officers of State."
Jeff run off to get the water, though, just like he hadn't been
sayin' any thing spiteful; for he's a raal good-hearted fellow, after all,
once you get at the foundation of him.
I walked into the house, and "Why, Peggy," says I, "I declare, we
like to forgot you altogether."
"Oh, yes!" says she, "when a body can't help themselves,
everybody soon forgets'em; but, thank God! by day after to-morrow
I shall be well enough to milk the cows, and pen the calves, and
wring the contrary ones' tails for'em, and no thanks to nobody."
"Good-evening, Peggy," says I; and so I sloped, for I seed she was
mad at me for making Jeff neglect her so long.
And now, Mr. Printer, will you be sure to let us know in your next
paper whether this Shields is a Whig or a Democrat? I don't care
about it for myself, for I know well enough how it is already; but I
want to convince Jeff. It may do some good to let him, and others
like him, know who and what those officers of State are. It may help
to send the present hypocritical set to where they belong, and to fill
the places they now disgrace with men who will do more work for
less pay, and take a fewer airs while they are doing it. It ain't
sensible to think that the same men who get us into trouble will
change their course; and yet it's pretty plain, if some change for the
better is not made, it's not long that either Peggy or I, or any of us,
will have a cow left to milk, or a calf's tail to wring.
Yours, truly,
Rebecca———.
Lost Townships, Sept. 8,1842. Dear Mr. Printer,—I was a-standin'
at the spring yesterday a-washin' out butter, when I seed Jim Snooks
a-ridin' up towards the house for very life like, when, jist as I was a
wonderin' what on airth was the matter with him, he stops suddenly,
and ses he, "Aunt'Becca, here's somethin' for you;" and with that he
hands out your letter. Well, you see I steps out towards him, not
thinkin' that I had both hands full of butter; and seein' I couldn't
take the letter, you know, without greasin' it, I ses, "Jim, jist you
open it, and read it for me." Well, Jim opens it, and reads it; and
would you believe it, Mr. Editor? I was so completely dumfounded,
and turned into stone, that there I stood in the sun, a-workin' the
butter, and it a-runnin' on the ground, while he read the letter, that I
never thunk what I was about till the hull on't run melted on the
ground, and was lost. Now, sir, it's not for the butter, nor the price of
the butter, but, the Lord have massy on us, I wouldn't have sich
another fright for a whole firkin of it. Why, when I found out that it
was the man what Jeff seed down to the fair that had demanded the
author of my letters, threatnin' to take personal satisfaction of the
writer, I was so skart that I tho't I should quill-wheel right where I
was.
You say that Mr. S. is offended at being compared to cat's fur, and
is as mad as a March hare (that ain't far), because I told about the
squeezin'. Now, I want you to tell Mr. S, that, rather than fight, I'll
make any apology; and, if he wants personal satisfaction, let him
only come here, and he may squeeze my hand as hard as I squeeze
the butter, and, if that ain't personal satisfaction, I can only say that
he is the fust man that was not satisfied with squeezin' my hand. If
this should not answer, there is one thing more that I would do
rather than get a lickin'. I have all along expected to die a widow;
but, as Mr. S. is rather good-looking than otherwise, I must say I
don't care if we compromise the matter by—really, Mr. Printer, I can't
help blushin'—but I—it must come out—I—but widowed modesty—
well, if I must, I must—wouldn't he—maybe sorter, let the old
grudge drap if I was to consent to be—be—h-i-s w-i-f-e? I know he's
a fightin' man, and would rather fight than eat; but isn't marryin'
better than fightin', though it does sometimes run into it? And I
don't think, upon the whole, that I'd be sich a bad match neither:
I'm not over sixty, and am just four feet three in my bare feet, and
not much more round the girth; and for color, I wouldn't turn my
back to nary gal in the Lost Townships. But, after all, maybe I'm
countin' my chickins before they' re hatched, and dreamin' of
matrimonial bliss when the only alternative reserved for me may be
a lickin'. Jeff tells me the way these fire-eaters do is to give the
challenged party choice of weapons, &c., which bein' the case, I'll
tell you in confidence that I never fights with any thing but
broomsticks, or hot water, or a shovelful of coals, or some such
thing; the former of which being somewhat like a shillalah, may not
be very objectionable to him. I will give him choice, however, in one
thing, and that is, whether, when we fight, I shall wear breeches or
he petticoats; for I presume that change is sufficient to place us on
an equality.
Yours, &c.
Rebecca———.
P. S.—Jist say to your friend, if he concludes to marry rather than
fight, I shall only inforce one condition: that is, if he should ever
happen to gallant any young gals home of nights from our house, he
must not squeeze their hands.
It is by no means a subject of wonder that these publications
threw Mr. James Shields into a state of wrath. A thin-skinned,
sensitive, high-minded, and high-tempered man, tender of his honor,
and an Irishman besides, it would have been strange indeed, if he
had not felt like snuffing blood. But his rage only afforded new
delights to his tormentors; and when it reached its height,
"Aunt'Becca" transformed herself to "Cathleen," and broke out in
rhymes like the following, which Miss Jayne's brother "Bill" kindly
consented to "drop" for the amiable ladies.
It was too bad. Mr. Shields could stand it no longer. He sent Gen.
Whiteside to Mr. Francis, to demand the name of the person who
wrote the letters from the "Lost Townships;" and Mr. Francis told him
it was A. Lincoln. This information led to a challenge, a sudden
scampering off of parties and friends to Missouri, a meeting, an
explanation, and a peaceful return.
Abraham Lincoln in the field of honor, sword in hand, manoeuvred
by a second learned in the duello, would be an attractive spectacle
under any circumstances. But with a celebrated man for an
antagonist, and a lady's humor the occasion, the scene is one of
transcendent interest; and the documents which describe it are well
entitled to a place in his history. The letter of Mr. Shields's second,
being first in date, is first in order.
Springfield, Oct. 3, 1842. To the Editor op "The Sangamon
Journal."
Sir,—To prevent misrepresentation of the recent affair between
Messrs. Shields and Lincoln, I think it proper to give a brief narrative
of the facts of the case, as they came within my knowledge; for the
truth of which I hold myself responsible, and request you to give the
same publication. An offensive article in relation to Mr. Shields
appeared in "The Sangamon Journal" of the 2d September last; and,
on demanding the author, Mr. Lincoln was given up by the editor. Mr.
Shields, previous to this demand, made arrangements to go to
Quincy on public business; and before his return Mr. Lincoln had left
for Tremont, to attend the court, with the intention, as we learned,
of remaining on the circuit several weeks. Mr. Shields, on his return,
requested me to accompany him to Tremont; and, on arriving there,
we found that Dr. Merryman and Mr. Butler had passed us in the
night, and got there before us. We arrived in Tremont on the 17th
ult.; and Mr. Shields addressed a note to Mr. Lincoln immediately,
informing him that he was given up as the author of some articles
that appeared in "The Sangamon Journal" (one more over the
signature having made its appearance at this time), and requesting
him to retract the offensive allusions contained in said articles in
relation to his private character. Mr. Shields handed this note to me
to deliver to Mr. Lincoln, and directed me, at the same time, not to
enter into any verbal communication, or be the bearer of any verbal
explanation, as such were always liable to misapprehension. This
note was delivered by me to Mr. Lincoln, stating, at the same time,
that I would call at his convenience for an answer. Mr. Lincoln, in the
evening of the same day, handed me a letter addressed to Mr.
Shields. In this he gave or offered no explanation, but stated therein
that he could not submit to answer further, on the ground that
Shields's note contained an assumption of facts and also a menace.
Mr. Shields then addressed him another note, in which he disavowed
all intention to menace, and requested to know whether he (Mr.
Lincoln) was the author of either of the articles which appeared in
"The Journal," headed "Lost Townships," and signed "Rebecca;" and,
if so, he repeated his request of a retraction of the offensive matter
in relation to his private character; if not, his denial would be held
sufficient. This letter was returned to Mr. Shields unanswered, with a
verbal statement "that there could be no further negotiation
between them until the first note was withdrawn." Mr. Shields
thereupon sent a note designating me as his friend, to which Mr.
Lincoln replied by designating Dr. Merryman. These three last notes
passed on Monday morning, the 19th. Dr. Merryman handed me Mr.
Lincoln's last note when by ourselves. I remarked to Dr. Merryman
that the matter was now submitted to us, and that I would propose
that he and myself should pledge our words of honor to each other
to try to agree upon terms of amicable arrangement, and compel
our principals to accept of them. To this he readily assented, and we
shook hands upon the pledge. It was then mutually agreed that we
should adjourn to Springfield, and there procrastinate the matter, for
the purpose of effecting the secret arrangement between him and
myself. All this I kept concealed from Mr. Shields. Our horse had got
a little lame in going to Tremont, and Dr. Merryman invited me to
take a seat in his buggy. I accepted the invitation the more readily,
as I thought, that leaving Mr. Shields in Tremont until his horse
would be in better condition to travel would facilitate the private
agreement between Dr. Merryman and myself. I travelled to
Springfield part of the way with him, and part with Mr. Lincoln; but
nothing passed between us on the journey in relation to the matter
in hand. We arrived in Springfield on Monday night. About noon on
Tuesday, to my astonishment, a proposition was made to meet in
Missouri, within three miles of Alton, on the next Thursday! The
weapons, cavalry broadswords of the largest size; the parties to
stand on each side of a barrier, and to be confined to a limited
space. As I had not been consulted at all on the subject, and
considering the private understanding between Dr. Merryman and
myself, and it being known that Mr. Shields was left at Tremont, such
a proposition took me by surprise. However, being determined not to
violate the laws of the State, I declined agreeing upon the terms
until we should meet in Missouri. Immediately after, I called upon Dr.
Merryman, and withdrew the pledge of honor between him and
myself in relation to a secret arrangement. I started after this to
meet Mr. Shields, and met him about twenty miles from Springfield.
It was late on Tuesday night when we both reached the city, and
learned that Dr. Merryman had left for Missouri, Mr. Lincoln having
left before the proposition was made, as Dr. Merryman had himself
informed me. The time and place made it necessary to start at once.
We left Springfield at eleven o'clock on Tuesday night, travelled all
night, and arrived in Hillsborough on Wednesday morning, where we
took in Gen. Ewing. From there we went to Alton, where we arrived
on Thursday; and, as the proposition required three friends on each
side, I was joined by Gen. Ewing and Dr. Hope, as the friends of Mr.
Shields.
We then crossed to Missouri, where a proposition was made by
Gen. Hardin and Dr. English (who had arrived there in the mean time
as mutual friends) to refer the matter to, I think, four friends for a
settlement. This I believed Mr. Shields would refuse, and declined
seeing him; but Dr. Hope, who conferred with him upon the subject,
returned, and stated that Mr. Shields declined settling the matter
through any other than the friends he had selected to stand by him
on that occasion. The friends of both the parties finally agreed to
withdraw the papers (temporarily) to give the friends of Mr. Lincoln
an opportunity to explain. Whereupon the friends of Mr. Lincoln, to
wit, Messrs. Merryman, Bledsoe, and Butler, made a full and
satisfactory explanation in relation to the article which appeared in
"The Sangamon Journal" of the 2d, the only one written by him. This
was all done without the knowledge or consent of Mr. Shields; and
he refused to accede to it until Dr. Hope, Gen. Ewing, and myself
declared the apology sufficient, and that we could not sustain him in
going further. I think it necessary to state further, that no
explanation or apology had been previously offered on the part of
Mr. Lincoln to Mr. Shields, and that none was ever communicated by
me to him, nor was any ever offered to me, unless a paper read to
me by Dr. Merryman after he had handed me the broadsword
proposition on Tuesday. I heard so little of the reading of the paper,
that I do not know fully what it purported to be; and I was the less
inclined to inquire, as Mr. Lincoln was then gone to Missouri, and Mr.
Shields not yet arrived from Tremont. In fact, I could not entertain
any offer of the kind, unless upon my own responsibility; and that I
was not disposed to do after what had already transpired.
I make this statement, as I am about to be absent for some time,
and I think it due to all concerned to give a true version of the
matter before I leave.
Your obedient servant,
John D. Whiteside.
To which Mr. Merryman replied:—
Springfield, Oct. 8, 1842.
Editors of "The Journal."
Gents,—By your paper of Friday, I discover that Gen. Whiteside
has published his version of the late affair between Messrs. Shields
and Lincoln. I now bespeak a hearing of my version of the same
affair, which shall be true and full as to all material facts.
On Friday evening, the 16th of September, I learned that Mr.
Shields and Gen. Whiteside had started in pursuit of Mr. Lincoln, who
was at Tremont, attending court. I knew that Mr. Lincoln was wholly
unpractised both as to the diplomacy and weapons commonly
employed in similar affairs; and I felt it my duty, as a friend, to be
with him, and, so far as in my power, to prevent any advantage
being taken of him as to either his honor or his life. Accordingly, Mr.
Butler and myself started, passed Shields and Whiteside in the night,
and arrived at Tremont ahead of them on Saturday morning. I told
Mr. Lincoln what was brewing, and asked him what course he
proposed to himself. He stated that he was wholly opposed to
duelling, and would do any thing to avoid it that might not degrade
him in the estimation of himself and friends; but, if such degradation
or a fight were the only alternative, he would fight.
In the afternoon Shields and Whiteside arrived, and very soon the
former sent to Mr. Lincoln by the latter the following note or letter:—
Tremont, Sept. 17,1842.
A. Lincoln, Esq.—I regret that my absence on public business
compelled me to postpone a matter of private consideration a little
longer than I could have desired. It will only be necessary, however,
to account for it by informing you that I have been to Quincy on
business that would not admit of delay. I will now state briefly the
reasons of my troubling you with this communication, the
disagreeable nature of which I regret, as I had hoped to avoid any
difficulty with any one in Springfield while residing there, by
endeavoring to conduct myself in such a way amongst both my
political friends and opponents, as to escape the necessity of any.
Whilst thus abstaining from giving provocation, I have become the
object of slander, vituperation, and personal abuse, which, were I
capable of submitting to, I would prove myself worthy of the whole
of it.
In two or three of the last number's of "The Sangamon Journal,"
articles of the most personal nature, and calculated to degrade me,
have made their appearance. On inquiring, I was informed by the
editor of that paper, through the medium of my friend, Gen.
Whiteside, that you are the author of those articles. This information
satisfies me that I have become, by some means or other, the object
of your secret hostility. I will not take the trouble of inquiring into the
reason of all this; but I will take the liberty of requiring a full,
positive, and absolute retraction of all offensive allusions used by
you in these communications, in relation to my private character and
standing as a man, as an apology for the insults conveyed in them.
This may prevent consequences which no one will regret more
than myself.
Your ob't serv't,
[Copy.] Jas. Shields.
About sunset Gen. Whiteside called again, and received from Mr.
Lincoln the following answer to Mr. Shields's note:—
Tremont, Sept. 17, 1812
Jas. Shields, Esq.—Your note of to-day was handed me by Gen.
Whiteside. In that note, you say you have been informed, through
the medium of the editor of "The Journal," that I am the author of
certain articles in that paper which you deem personally abusive of
you; and, without stopping to inquire whether I really am the author,
or to point out what is offensive in them, you demand an unqualified
retraction of all that is offensive, and then proceed to hint at
consequences.
Now, sir, there is in this so much assumption of facts, and so much
of menace as to consequences, that I cannot submit to answer that
note any further than I have, and to add, that the consequence to
which I suppose you allude would be matter of as great regret to me
as it possibly could to you. Respectfully,
A. Lincoln.
In about an hour Gen. Whiteside called again with another note
from Mr. Shields; but after conferring with Mr. Butler for a long time,
say two or three hours, returned without presenting the note to Mr.
Lincoln. This was in consequence of an assurance from Mr. Butler
that Mr. Lincoln could not receive any communication from Mr.
Shields, unless it were a withdrawal of his first note, or a challenge.
Mr. Butler further stated to Gen. Whiteside, that, on the withdrawal
of the first note, and a proper and gentlemanly request for an
explanation, he had no doubt one would be given. Gen. Whiteside
admitted that that was the course Mr. Shields ought to pursue, but
deplored that his furious and intractable temper prevented his
having any influence with him to that end. Gen. W. then requested
us to wait with him until Monday morning, that he might endeavor
to bring Mr. Shields to reason.
On Monday morning he called and presented Mr. Lincoln the same
note as, Mr. Butler says, he had brought on Saturday evening. It was
as follows:—
Tremont, Sept. 17, 1842.
A. Lincoln, Esq.—In your reply to my note of this date, you
intimate that I assume facts and menace consequences, and that
you cannot submit to answer it further. As now, sir, you desire it, I
will be a little more particular. The editor of "The Sangamon Journal"
gave me to understand that you are the author of an article which
appeared, I think, in that paper of the 2d September inst., headed
"The Lost Townships," and signed Rebecca or 'Becca. I would
therefore take the liberty of asking whether you are the author of
said article, or any other over the same signature which has
appeared in any of the late numbers of that paper. If so, I repeat my
request of an absolute retraction of all offensive allusion contained
therein in relation to my private character and standing. If you are
not the author of any of the articles, your denial will be sufficient. I
will say further, it is not my intention to menace, but to do myself
justice.
Your ob't serv't,
[Copy.] Jas. Shields.
This Mr. Lincoln perused, and returned to Gen. Whiteside, telling
him verbally, that he did not think it consistent with his honor to
negotiate for peace with Mr. Shields, unless Mr. Shields would
withdraw his former offensive letter.
In a very short time Gen. Whiteside called with a note from Mr.
Shields, designating Gen. Whiteside as his friend, to which Mr.
Lincoln instantly replied, designating me as his. On meeting Gen.
Whiteside, he proposed that we should pledge our honor to each
other that we would endeavor to settle the matter amicably; to
which I agreed, and stated to him the only conditions on which it
could be so settled; viz., the withdrawal of Mr. Shields's first note;
which he appeared to think reasonable, and regretted that the note
had been written,—saying, however, that he had endeavored to
prevail on Mr. Shields to write a milder one, but had not succeeded.
He added, too, that I must promise not to mention it, as he would
not dare to let Mr. Shields know that he was negotiating peace; for,
said he, "He would challenge me next, and as soon cut my throat as
not." Not willing that he should suppose my principal less dangerous
than his own, I promised not to mention our pacific intentions to Mr.
Lincoln or any other person; and we started for Springfield forthwith.
We all, except Mr. Shields, arrived in Springfield late at night on
Monday. We discovered that the affair had, somehow, got great
publicity in Springfield, and that an arrest was probable. To prevent
this, it was agreed by Mr. Lincoln and myself that he should leave
early on Tuesday morning. Accordingly, he prepared the following
instructions for my guide, on a suggestion from Mr. Butler that he
had reason to believe that an attempt would be made by the
opposite party to have the matter accommodated:—
In case Whiteside shall signify a wish to adjust this affair without
further difficulty, let him know, that, if the present papers be
withdrawn, and a note from Mr. Shields asking to know if I am the
author of the articles of which he complains, and asking that I shall
make him gentlemanly satisfaction if I am the author, and this
without menace or dictation as to what that satisfaction shall be, a
pledge is made that the following answer shall be given:—
"I did write the 'Lost Township' letter which appeared in the
'Journal' of the 2d inst., but had no participation in any form in any
other article alluding to you. I wrote that wholly for political effect. I
had no intention of injuring your personal or private character, or
standing as a man or a gentleman; and I did not then think, and do
not now think, that that article could produce, or has produced, that
effect against you; and, had I anticipated such an effect, would have
forborne to write it. And I will add, that your conduct towards me, so
far as I knew, had always been gentlemanly, and that I had no
personal pique against you, and no cause for any."
If this should be done, I leave it with you to manage what shall
and what shall not be published.
If nothing like this is done, the preliminaries of the fight are to be:
—
1st, Weapons.—Cavalry broadswords of the largest size, precisely
equal in all respects, and such as now used by the cavalry company
at Jacksonville.
2d, Position.—A plank ten feet long, and from nine to twelve
inches broad, to be firmly fixed on edge on the ground as the line
between us, which neither is to pass his foot over upon forfeit of his
life. Next, a line drawn on the ground on either side of said plank
and parallel with it, each at the distance of the whole length of the
sword and three feet additional from the plank; and the passing of
his own such line by either party during the fight shall be deemed a
surrender of the contest.
3d, Time.—On Thursday evening at 5 o'clock, if you can get it so;
but in no case to be at a greater distance of time than Friday
evening at 5 o'clock.
4th, Place.—Within three miles of Alton, on the opposite side of
the river, the particular spot to be agreed on by you.
Any preliminary details coming within the above rules, you are at
liberty to make at your discretion; but you are in no case to swerve
from these rules, or to pass beyond their limits.
In the course of the forenoon I met Gen. Whiteside, and he again
intimated a wish to adjust the matter amicably. I then read to him
Mr. Lincoln's instructions to an adjustment, and the terms of the
hostile meeting, if there must be one, both at the same time.
He replied that it was useless to talk of an adjustment, if it could
only be effected by the withdrawal of Mr. Shields's paper, for such
withdrawal Mr. Shields would never consent to; adding, that he
would as soon think of asking Mr. Shields to "butt his brains out
against a brick wall as to withdraw that paper." He proceeded: "I see
but one course,—that is a desperate remedy:'tis to tell them, if they
will not make the matter up, they must fight us." I replied, that, if he
chose to fight Mr. Shields to compel him to do right, he might do so;
but as for Mr. Lincoln, he was on the defensive, and, I believed, in
the right, and I should do nothing to compel him to do wrong. Such
withdrawal having been made indispensable by Mr. Lincoln, I cut this
matter short as to an adjustment, an I proposed to Gan. Whiteside
to accept the terms of the fight, which he refused to do until Mr.
Shields's arrival in town, but agreed, verbally, that Mr. Lincoln's
friends should procure the broadswords, and take them to the
ground. In the afternoon he came to me, saying that some persons
were swearing out affidavits to have us arrested, and that he
intended to meet Mr. Shields immediately, and proceed to the place
designated; lamenting, however, that I would not delay the time,
that he might procure the interference of Gov. Ford and Gen. Ewing
to mollify Mr. Shields. I told him that an accommodation, except
upon the terms I mentioned, was out of the question; that to delay
the meeting was to facilitate our arrest; and, as I was determined
not to be arrested, I should leave town in fifteen minutes. I then
pressed his acceptance of the preliminaries, which he disclaimed
upon the ground that it would interfere with his oath of office as
Fund Commissioner. I then, with two other friends, went to
Jacksonville, where we joined Mr. Lincoln about 11 o'clock on
Tuesday night. Wednesday morning we procured the broadswords,
and proceeded to Alton, where we arrived about 11, A.M., on
Thursday. The other party were in town before us. We crossed the
river, and they soon followed. Shortly after, Gen. Hardin and Dr.
English presented to Gen. Whiteside and myself the following note:
—
Alton, Sept. 22, 1842.
Messrs. Whiteside and Merryman.—As the mutual personal friends
of Messrs. Shields and Lincoln, but without authority from either, we
earnestly desire to see a reconciliation of the misunderstanding
which exists between them. Such difficulties should always be
arranged amicably, if it is possible to do so with honor to both
parties.
Believing ourselves, that such an arrangement can possibly be
effected, we respectfully, but earnestly, submit the following
proposition for your consideration:—
Let the whole difficulty be submitted to four or more gentlemen,
to be selected by yourselves, who shall consider the affair, and
report thereupon for your consideration.
John J. Hardin.
E. W. English.
To this proposition Gen. Whiteside agreed: I declined doing so
without consulting Mr. Lincoln. Mr. Lincoln remarked, that, as they
had accepted the proposition, he would do so, but directed that his
friends should make no terms except those first proposed. Whether
the adjustment was finally made upon these very terms, and no
other, let the following documents attest:—
Missouri, Sept. 22, 1842.
Gentlemen,—All papers in relation to the matter in controversy
between Mr. Shields and Mr. Lincoln having been withdrawn by the
friends of the parties concerned, the friends of Mr. Shields ask the
friends of Mr. Lincoln to explain all offensive matter in the articles
which appeared in "The Sangamon Journal" of the 2d, 9th, and 16th
of September, under the signature of "Rebecca," and headed "Lost
Townships."
It is due to Gen. Hardin and Mr. English to state that their
interference was of the most courteous and gentlemanly character.
John D. Whiteside.
Wm. Lee D. Ewino.
T. M. Hope.
Missouri, Sept. 22, 1842.
Gentlemen,—All papers in relation to the matter in controversy
between Mr. Lincoln and Mr. Shields having been withdrawn by the
friends of the parties concerned, we, the undersigned, friends of Mr.
Lincoln, in accordance with your request that explanation of Mr.
Lincoln's publication in relation to Mr. Shields in "The Sangamon
Journal" of the 2d, 9th, and 16th of September be made, take
pleasure in saying, that, although Mr. Lincoln was the writer of the
article signed "Rebecca" in the "Journal" of the 2d, and that only, yet
he had no intention of injuring the personal or private character or
standing of Mr. Shields as a gentleman or a man, and that Mr.
Lincoln did not think, nor does he now think, that said article could
produce such an effect; and, had Mr. Lincoln anticipated such an
effect, he would have forborne to write it. We will further state, that
said article was written solely for political effect, and not to gratify
any personal pique against Mr. Shields, for he had none, and knew
of no cause for any It is due to Gen. Hanlin and Mr. English to say
that their interference was of the most courteous and gentlemanly
character.
E. H. Merryman.
A. T. Bledsoe.
Wm. Butler.
Let it be observed now, that Mr. Shields's friends, after agreeing to
the arbitrament of four disinterested gentlemen, declined the
contract, saying that Mr. Shields wished his own friends to act for
him. They then proposed that we should explain without any
withdrawal of papers. This was promptly and firmly refused, and
Gen. Whiteside himself pronounced the papers withdrawn. They
then produced a note requesting us to "disavow" all offensive
intentions in the publications, &c., &c. This we declined answering,
and only responded to the above request for an explanation.
These are the material facts in relation to the matter, and I think
present the case in a very different light from the garbled and
curtailed statement of Gen. Whiteside. Why he made that statement
I know not, unless he wished to detract from the honor of Mr.
Lincoln. This was ungenerous, more particularly as he on the ground
requested us not to make in our explanation any quotations from the
"Rebecca papers;" also not to make public the terms of
reconciliation, and to unite with them in defending the honorable
character of the adjustment.
Gen. W., in his publication, says, "The friends of both parties
agreed to withdraw the papers (temporarily) to give the friends of
Mr. Lincoln an opportunity to explain." This I deny. I say the papers
were withdrawn to enable Mr. Shields's friends to ask an
explanation; and I appeal to the documents for proof of my position.
By looking over these documents, it will be seen that Mr. Shields
had not before asked for an explanation, but had all the time been
dictatorily insisting on a retraction.
Gen. Whiteside, in his communication, brings to light much of Mr.
Shields's manifestations of bravery behind the scenes. I can do
nothing of the kind for Mr. Lincoln. He took his stand when I first
met him at Tremont, and maintained it calmly to the last, without
difficulty or difference between himself and his friends.
I cannot close this article, lengthy as it is, without testifying to the
honorable and gentlemanly conduct of Gen. Ewing and Dr. Hope, nor
indeed can I say that I saw any thing objectionable in the course of
Gen. Whiteside up to the time of his communication. This is so
replete with prevarication and misrepresentation, that I cannot
accord to the General that candor which I once supposed him to
possess. He complains that I did not procrastinate time according to
agreement. He forgets that by his own act he cut me off from that
chance in inducing me, by promise, not to communicate our secret
contract to Mr. Lincoln. Moreover, I could see no consistency in
wishing for an extension of time at that stage of the affair, when in
the outset they were in so precipitate a hurry, that they could not
wait three days for Mr. Lincoln to return from Tremont, but must
hasten there, apparently with the intention of bringing the matter to
a speedy issue. He complains, too, that, after inviting him to take a
seat in my buggy, I never broached the subject to him on our route
here. But was I, the defendant in the case, with a challenge hanging
over me, to make advances, and beg a reconciliation? Absurd!
Moreover, the valorous general forgets that he beguiled the tedium
of the journey by recounting to me his exploits in many a well-
fought battle,—dangers by "flood and field" in which I don't believe
he ever participated,—doubtless with a view to produce a salutary
effect on my nerves, and impress me with a proper notion of his fire-
eating propensities.
One more main point of his argument, and I have done. The
General seems to be troubled with a convenient shortness of
memory on some occasions. He does not remember that any
explanations were offered at any time, unless it were a paper read
when the "broadsword proposition" was tendered, when his mind
was so confused by the anticipated clatter of broadswords, or
something else, that he did "not know fully what it purported to be."
The truth is, that by unwisely refraining from mentioning it to his
principal, he placed himself in a dilemma which he is now
endeavoring to shuffle out of. By his inefficiency, and want of
knowledge of those laws which govern gentlemen in matters of this
kind, he has done great injustice to his principal, a gentleman who I
believe is ready at all times to vindicate his honor manfully, but who
has been unfortunate in the selection of his friend; and this fault he
is now trying to wipe out by doing an act of still greater injustice to
Mr. Lincoln.
E. H. Merryman.
And so Mr. Lincoln acknowledged himself to have been the author
of one of the "Lost Township Letters." Whether he was or not, was
known only perhaps to Miss Todd and himself. At the time of their
date, he was having secret meetings with her at Mr. Francis's house,
and endeavoring to nerve himself to the duty of marrying her, with
what success the letters to Speed are abundant evidence. It is
probable that Mary composed them fresh from these stolen
conferences; that some of Mr. Lincoln's original conceptions and
peculiarities of style unwittingly crept into them, and that here and
there he altered and amended the manuscript before it went to the
printer. Such a connection with a lady's productions made it
obligatory upon him to defend them. But why avow one, and
disavow the rest? It is more than likely that he was determined to
take just enough responsibility to fight upon, provided Shields should
prove incorrigible, and not enough to prevent a peaceful issue, if the
injured gentleman should be inclined to accept an apology.
After his marriage, Mr. Lincoln took up his residence at the "Globe
Tavern," where he had a room and boarding for man and wife for
the moderate sum of four dollars per week. But, notwithstanding
cheap living, he was still as poor as ever, and gave "poverty" as one
of his reasons for not paying a friendly visit which seemed to be
expected of him.
At the bar and in political affairs he continued to work with as
much energy as before, although his political prospects seem just
now to have suffered an unexpected eclipse. In 1843, Lincoln,
Hardin, and Baker were candidates for the Whig congressional
nomination; but between Hardin and Baker there was "bitter
hostility," and between Baker and Lincoln "suspicion and dislike."
The contest was long and fierce; but, before it was over, Lincoln
reluctantly withdrew in favor of Baker. He had had a hard time of it,
and had been compelled to meet accusations of a very strange
character. Among other things, he was charged with being an
aristocrat; with having deserted his old friends, the people, by
marrying a proud woman on account of her blood and family. This
hurt him keenly, and he took great pains to disprove it; but this was
not all. He was called an infidel by some, a Presbyterian here, an
Episcopalian there; so that by turns he incurred the hostility of all
the most powerful religious societies in the district.
On the 24th of March, he wrote to Mr. Speed as follows:—
Springfield, March 24, 1843.
Dear Speed,—... We had a meeting of the Whigs of the county
here on last Monday to appoint delegates to a district convention;
and Baker beat me, and got the delegation instructed to go for him.
The meeting, in spite of my attempt to decline it, appointed me one
of the delegates; so that, in getting Baker the nomination, I shall be
fixed a good deal like a fellow who is made a groomsman to a man
that has cut him out, and is marrying his own dear "gal." About the
prospects of your having a namesake at our town, can't say exactly
yet.
A. Lincoln.
He was now a Baker delegate, pledged to get him the nomination
if he could; and yet he was far from giving up the contest in his own
behalf. Only two days after the letter to Speed, he wrote to Mr.
Morris:—
Springfield, Ill., March 26, 1843.
Friend Morris,—Your letter of the 23d was received on yesterday
morning, and for which (instead of an excuse, which you thought
proper to ask) I tender you my sincere thanks. It is truly gratifying to
me to learn, that, while the people of Sangamon have cast me off,
my old friends of Menard, who have known me longest and best,
stick to me. It would astonish, if not amuse, the older citizens (a
stranger, friendless, uneducated, penniless boy, working on a flat-
boat at ten dollars per month) to learn that I have been put down
here as the candidate of pride, wealth, and aristocratic family
distinction. Yet so, chiefly, it was. There was, too, the strangest
combination of church-influence against me. Baker is a Campbellite;
and therefore, as I suppose, with few exceptions, got all that church.
My wife has some relations in the Presbyterian churches, and
some with the Episcopal churches; and therefore, wherever it would
tell, I was set down as either the one or the other, while it was
everywhere contended that no Christian ought to go for me, because
I belonged to no church, was suspected of being a deist, and had
talked about fighting a duel. With all these things, Baker, of course,
had nothing to do. Nor do I complain of them. As to his own church
going for him, I think that was right enough: and as to the
influences I have spoken of in the other, though they were very
strong, it would be grossly untrue and unjust to charge that they
acted upon them in a body, or were very near so. I only mean that
those influences levied a tax of a considerable per cent upon my
strength throughout the religious controversy. But enough of this.
You say, that, in choosing a candidate for Congress, you have an
equal right with Sangamon; and in this you are undoubtedly earnest.
In agreeing to withdraw if the Whigs of Sangamon should go against
me, I did not mean that they alone were worth consulting, but that
if she, with her heavy delegation, should be against me, it would be
impossible for me to succeed; and therefore I had as well decline.
And in relation to Menard having rights, permit me fully to recognize
them, and to express the opinion, that, if she and Mason act
circumspectly, they will in the convention be able so far to enforce
their rights as to decide absolutely which one of the candidates shall
be successful. Let me show the reason of this. Hardin, or some other
Morgan candidate, will get Putnam, Marshall, Woodford, Tazewell,
and Logan,—make sixteen. Then you and Mason, having three, can
give the victory to either side.
You say you shall instruct your delegates for me, unless I object. I
certainly shall not object. That would be too pleasant a compliment
for me to tread in the dust. And besides, if any thing should happen
(which, however, is not probable) by which Baker should be thrown
out of the fight, I would be at liberty to accept the nomination if I
could get it. I do, however, feel myself bound not to hinder him in
any way from getting the nomination. I should despise myself were I
to attempt it. I think, then, it would be proper for your meeting to
appoint three delegates, and to instruct them to go for some one as
a first choice, some one else as a second, and perhaps some one as
a third; and, if in those instructions I were named as the first choice,
it would gratify me very much.
If you wish to hold the balance of power, it is important for you to
attend to and secure the vote of Mason also. You should be sure to
have men appointed delegates that you know you can safely confide
in. If yourself and James Short were appointed for your county, all
would be safe; but whether Jim's woman affair a year ago might not
be in the way of his appointment is a question. I don't know whether
you know it, but I know him to be as honorable a man as there is in
the world. You have my permission, and even request, to show this
letter to Short; but to no one else, unless it be a very particular
friend, who you know will not speak of it.
Yours as ever,
A. Lincoln.
P. S.—Will you write me again?
To Martin M. Morris, Petersburg, 111.
And finally to Speed on the same subject:—
Springfield, May 18, 1843.
Dear Speed,—Yours of the 9th inst. is duly received, which I do
not meet as a "bore," but as a most welcome visitor. I will answer
the business part of it first.
In relation to our Congress matter here, you were right in
supposing I would support the nominee. Neither Baker nor I,
however, is the man, but Hardin, so far as I can judge from present
appearances. We shall have no split or trouble about the matter,—all
will be harmony. In relation to the "coming events" about which
Butler wrote you, I had not heard one word before I got your letter;
but I have so much confidence in the judgment of a Butler on such a
subject, that I incline to think there may be some reality in it. What
day does Butler appoint? By the way, how do "events" of the same
sort come on in your family? Are you possessing houses and lands,
and oxen and asses, and men-servants and maid-servants, and
begetting sons and daughters? We are not keeping house, but
boarding at the Globe Tavern, which is very well kept now by a
widow lady of the name of Beck. Our room (the same Dr. Wallace
occupied there) and boarding only costs us four dollars a week. Ann
Todd was married something more than a year since to a fellow by
the name of Campbell, and who, Mary says, is pretty much of a
"dunce," though he has a little money and property. They live in
Boonville, Mo., and have not been heard from lately enough for me
to say any thing about her health. I reckon it will scarcely be in our
power to visit Kentucky this year. Besides poverty and the necessity
of attending to business, those "coming events," I suspect, would be
somewhat in the way. I most heartily wish you and your Fanny
would not fail to come. Just let us know the time, and we will have a
room provided for you at our house, and all be merry together for a
while. Be sure to give my respects to your mother and family: assure
her, that, if I ever come near her, I will not fail to call and see her.
Mary joins in sending love to your Fanny and you.
Yours as ever,
A. Lincoln.
After the "race," still smarting from the mortification of defeat, and
the disappointment of a cherished hope, he took his old friend Jim
Matheny away off to a solitary place in the woods, "and then and
there," "with great emphasis," protested that he had not grown
proud, and was not an aristocrat. "Jim," said he, in conclusion, "I am
now, and always shall be, the same Abe Lincoln that I always was."
CHAPTER XII
IN 1844 Mr. Lincoln was again a candidate for elector on the Whig
ticket. Mr. Clay, as he has said himself, was his "beau-ideal of a
statesman," and he labored earnestly and as effectually as any one
else for his election. For the most part, he still had his old
antagonists to meet in the Springfield region, chief among whom
this year was John Calhoun. With him and others he had joint
debates, running through several nights, which excited much
popular feeling. One of his old friends and neighbors, who attended
all these discussions, speaks in very enthusiastic terms of Mr.
Calhoun, and, after enumerating his many noble gifts of head and
heart, concludes that "Calhoun came nearer of whipping Lincoln in
debate than Douglas did."
Mr. Lincoln made many speeches in Illinois, and finally, towards
the close of the campaign, he went over into Indiana, and there
continued "on the stump" until the end. Among other places he
spoke at Rockport on the Ohio,—where he had first embarked for
New Orleans with Gentry,—at Gentryville, and at a place in the
country about two miles from the cabin where his father had lived.
While he was in the midst of his speech at Gentryville, his old friend,
Nat Grigsby, entered the room. Lincoln recognized him on the
instant, and, stopping short in his remarks, cried out, "There's Nat!"
Without the slightest regard for the proprieties of the occasion, he
suspended his address totally, and, striding from the platform, began
scrambling through the audience and over the benches, toward the
modest Nat, who stood near the door. When he reached him, Lincoln
shook his hand "cordially;" and, after felicitating himself sufficiently
upon the happy meeting, he returned to the platform, and finished
his speech. When that was over, Lincoln could not make up his mind
to part with Nat, but insisted that they must sleep together.
Accordingly, they wended their way to Col. Jones's, where that fine
old Jackson Democrat received his distinguished "clerk" with all the
honors he could show him. Nat says, that in the night a cat "began
mewing, scratching, and making a fuss generally." Lincoln got up,
took the cat in his hands, and stroking its back "gently and kindly,"
made it sparkle for Nat's amusement. He then "gently" put it out of
the door, and, returning to bed, "commenced telling stories and
talking over old times."
It is hardly necessary to say, that the result of the canvass was a
severe disappointment to Mr. Lincoln. No defeat but his own could
have given him more pain; and thereafter he seems to have
attended quietly to his own private business until the Congressional
canvass of 1846.
It was thought for many years by some persons well informed,
that between Lincoln, Logan, Baker, and Hardin,—four very
conspicuous Whig leaders,—there was a secret personal
understanding that they four should "rotate" in Congress until each
had had a term. Baker succeeded Hardin in 1844; Lincoln was
elected in 1846, and Logan was nominated, but defeated, in 1848.
Lincoln publicly declined to contest the nomination with Baker in
1844; Hardin did the same for Lincoln in 1846 (although both seem
to have acted reluctantly), and Lincoln refused to run against Logan
in 1848. Col. Matheny and others insist, with great show of reason,
that the agreement actually existed; and, if such was the case, it
was practically carried out, although Lincoln was a candidate against
Baker, and Hardin against Lincoln, as long as either of them thought
there was the smallest prospect of success. They might have done
this, however, merely to keep other and less tractable candidates out
of the field. That Lincoln would cheerfully have made such a bargain
to insure himself a seat in Congress, there can be no doubt; but the
supposition that he did do it can scarcely be reconciled with the
feeling displayed by him in the conflict with Baker, or the persistency
of Hardin, to a very late hour, in the contest of 1846.
At all events, Mr. Lincoln and Gen. Hardin were the two, and the
only two, candidates for the Whig nomination in 1846. The contest
was much like the one with Baker, and Lincoln was assailed in much
the same fashion. He was called a deist and an infidel, both before
and after his nomination, and encountered in a less degree the same
opposition from the members of certain religious bodies that had
met him before. But with Hardin he maintained personal relations
the most friendly. The latter proposed to alter the mode of making
the nomination; and, in the letter conveying this desire to Mr.
Lincoln, he also offered to stipulate that each candidate should
remain within the limits of his own county. To this Mr. Lincoln replied,
"As to your proposed stipulation that all the candidates shall remain
in their own counties, and restrain their friends to the same, it
seems to me, that, on reflection, you will see the fact of your having
been in Congress has, in various ways, so spread your name in the
district as to give you a decided advantage in such a stipulation. I
appreciate your desire to keep down excitement, and I promise you
to 'keep cool' under the circumstances."
On the 26th of February, 1846, "The Journal" contained Gen.
Hardin's card declining to be "longer considered a candidate," and in
its editorial comments occurred the following: "We have had, and
now have, no doubt that he (Hardin) has been, and now is, a great
favorite with the Whigs of the district. He states, in substance, that
there was never any understanding on his part that his name was
not to be presented in the canvasses of 1844 and 1846. This, we
believe, is strictly true. Still, the doings of the Pekin Convention did
seem to point that way; and the general's voluntary declination as to
the canvass of 1844 was by many construed into an acquiescence on
his part. These things had led many of his most devoted friends to
not expect him to be a candidate at this time. Add to this the
relation that Mr. Lincoln bears, and has borne, to the party, and it is
not strange that many of those who are as strongly devoted to Gen.
Hardin as they are to Mr. Lincoln should prefer the latter at this time.
We do not entertain a doubt, that, if we could reverse the positions
of the two men, that a very large portion of those who now have
supported Mr. Lincoln most warmly would have supported Gen.
Hardin quite as warmly." This article was admirably calculated to
soothe Gen. Hardin, and to win over his friends. It was wise and
timely. The editor was Mr. Lincoln's intimate friend. It is marked by
Mr. Lincoln's style, and has at least one expression which was
peculiar to him.
In its issue of May 7, "The Journal" announced the nomination as
having been made at Petersburg, on the Friday previous, and said
further, "This nomination was, of course, anticipated, there being no
other candidate in the field. Mr. Lincoln, we all know, is a good Whig,
a good man, an able speaker, and richly deserves, as he enjoys, the
confidence of the Whigs of this district and of the State."
Peter Cartwright, the celebrated pioneer Methodist preacher, noted
for his piety and combativeness, was Mr. Lincoln's competitor before
the people. We know already the nature of the principal charges
against Mr. Lincoln's personal character; and these, with the usual
criticism upon Whig policy, formed the staple topics of the campaign
on the Democratic side. But Peter himself did not escape with that
impunity which might have been expected in the case of a minister
of the gospel. Rough tongues circulated exaggerated stories of his
wicked pugnacity and his worldly-mindedness, whilst the pretended
servant of the Prince of peace. Many Democrats looked with intense
disgust upon his present candidacy, and believed, that, by mingling
in politics, he was degrading his office and polluting the Church. One
of these Democrats told Mr. Lincoln what he thought, and said, that,
although it was a hard thing to vote against his party, he would do it
if it should be necessary to defeat Cartwright. Mr. Lincoln told him,
that on the day of the election he would give him a candid opinion
as to whether the vote was needed or not Accordingly, on that day,
he called upon the gentleman, and said, "I have got the preacher,...
and don't want your vote."
Clay's majority in this district in 1844 had been but nine hundred
and fourteen; whereas it now gave Mr. Lincoln a majority of fifteen
hundred and eleven, in a year which had no Presidential excitements
to bring out electors. In 1848 Gen. Taylor's majority was smaller by
ten, and the same year the Whig candidate for Congress was
defeated by a hundred and six.
In the following letter to Mr. Speed, he intimates that the first
sensations of pleasure attending his new distinction were not of long
duration; at least, that there were moments in which, if he did not
forget his greatness, it afforded him little joy.
Springfield, Oct. 22, 1846.
Dear Speed,—
You no doubt assign the suspension of our correspondence to the
true philosophic cause; though it must be confessed by both of us,
that this is rather a cold reason for allowing a friendship such as
ours to die out by degrees. I propose now, that, upon receipt of this,
you shall be considered in my debt, and under obligations to pay
soon, and that neither shall remain long in arrears hereafter. Are you
agreed?
Being elected to Congress, though I am very grateful to our
friends for having done it, has not pleased me as much as I
expected.
We have another boy, born the 10th of March. He is very much
such a child as Bob was at his age, rather of a longer order. Bob is
"short and low," and expect always will be. He talks very plainly,—
almost as plainly as anybody. He is quite smart enough. I sometimes
fear he is one of the little rare-ripe sort, that are smarter at about
five than ever after. He has a great deal of that sort of mischief that
is the offspring of much animal spirits. Since I began this letter, a
messenger came to tell me Bob was lost; but by the time I reached
the house his mother had found him, and had him whipped; and by
now, very likely, he is run away again. Mary has read your letter, and
wishes to be remembered to Mrs. S. and you, in which I most
sincerely join her. As ever yours.
A. Lincoln.
At the meeting of the Thirtieth Congress Mr. Lincoln took his seat,
and went about the business of his office with a strong
determination to do something memorable. He was the only Whig
member from Illinois, and would be carefully watched. His
colleagues were several of them old acquaintances of the Vandalia
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
ebookbell.com