The Python 3 Standard Library By Example Hellmann Doug instant download
The Python 3 Standard Library By Example Hellmann Doug instant download
https://ebookbell.com/product/the-python-3-standard-library-by-
example-hellmann-doug-21354604
https://ebookbell.com/product/the-python-3-standard-library-by-
example-second-doug-hellmann-5913574
https://ebookbell.com/product/the-python-3-standard-library-by-
example-1st-edition-doug-hellmann-6735550
https://ebookbell.com/product/cpython-internals-your-guide-to-the-
python-3-interpreter-1st-edition-anthony-shaw-11947410
https://ebookbell.com/product/cpython-internals-your-guide-to-the-
python-3-interpreter-1st-edition-anthony-shaw-49565250
Network Programming In Python The Basic A Detailed Guide To Python 3
Network Programming And Management John Galbraith
https://ebookbell.com/product/network-programming-in-python-the-basic-
a-detailed-guide-to-python-3-network-programming-and-management-john-
galbraith-43743954
https://ebookbell.com/product/learn-python-3-the-hard-way-a-very-
simple-introduction-to-the-terrifyingly-beautiful-world-of-computers-
and-code-pdfdrivecom-zed-a-shaw-50384078
https://ebookbell.com/product/learn-python-3-the-hard-way-a-very-
simple-introduction-to-the-terrifyingly-beautiful-world-of-computers-
and-code-zed-a-shaw-43272374
https://ebookbell.com/product/learn-python-3-the-hard-way-a-very-
simple-introduction-to-the-terrifyingly-beautiful-world-of-computers-
and-code-alan-mainwarings-library-zed-a-shaw-230941080
https://ebookbell.com/product/learn-python-3-the-hard-way-a-very-
simple-introduction-to-the-terrifyingly-beautiful-world-of-computers-
and-code-zed-shaws-hard-way-series-zed-a-shaw-31700994
Musée d’Orsay, Paris, France
Located on the Seine’s left bank, the Musée d’Orsay
is housed in a breathtaking Beaux-Arts building originally
designed as the world’s first electrified urban railway
station. The original “Gare d’Orsay” was built on the
site of the old Palais d’Orsay, which had lain empty
since it burned in 1871 during the Paris Commune.
The building opened on Bastille Day, July 14, 1900,
to help celebrate Paris’s Fifth Universal Exhibition.
Designated a Historical Monument in 1978, it was
then recreated as a museum by Renaud Bardon,
Pierre Colboc, and Jean-Paul Philippon of the ACT
architecture group. Per the museum’s official history,
the new architects “highlighted the great hall, using
it as the main artery of the visit, and transformed
the magnificent glass awning into the museum’s
entrance.” Inside, Gae Aulenti adapted the enormous
station into museum spaces, unified via consistent
stone wall and floor surfaces. Opened in 1986,
the new museum brought together three major
art collections from the era 1848-1914. More than
three million visitors now come every year to see
works from artists including Cézanne, Courbet,
Degas, Gauguin, Manet, Monet, and Renoir.
The Python 3
Standard Library
by Example
Developer’s Library
Developer’s Library titles cover a wide range of topics, from open source
programming languages and technologies, mobile application development,
and web development to Java programming and more.
The Py thon 3
Standard Library
by Example
Doug Hellmann
Boston • Columbus • Indianapolis • New York • San Francisco • Amsterdam • Cape Town
Dubai • London • Madrid • Milan • Munich • Paris • Montreal • Toronto • Delhi • Mexico City
São Paulo • Sydney • Hong Kong • Seoul • Singapore • Taipei • Tokyo
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and the publisher was aware of a trademark
claim, the designations have been printed with initial capital letters or in all capitals.
The author and publisher have taken care in the preparation of this book, but make no expressed or
implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed
for incidental or consequential damages in connection with or arising out of the use of the information or
programs contained herein.
For information about buying this title in bulk quantities, or for special sales opportunities (which
may include electronic versions; custom cover designs; and content particular to your business, train-
ing goals, marketing focus, or branding interests), please contact our corporate sales department at
corpsales@pearsoned.com or (800) 382-3419.
For questions about sales outside the U.S., please contact intlcs@pearson.com.
All rights reserved. Printed in the United States of America. This publication is protected by copyright, and
permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval
system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or like-
wise. For information regarding permissions, request forms and the appropriate contacts within the Pearson
Education Global Rights & Permissions Department, please visit www.pearsoned.com/permissions/.
ISBN-13: 978-0-13-429105-5
ISBN-10: 0-13-429105-0
1 17
For Theresa,
my one true love.
This page intentionally left blank
Contents at a Glance
Introduction xxxi
Acknowledgments xxxiii
Chapter 1 Text 1
Index 1375
Contents
Introduction xxxi
Acknowledgments xxxiii
Chapter 1 Text 1
1.1 string: Text Constants and Templates 1
1.1.1 Functions 1
1.1.2 Templates 2
1.1.3 Advanced Templates 4
1.1.4 Formatter 6
1.1.5 Constants 6
1.2 textwrap: Formatting Text Paragraphs 7
1.2.1 Example Data 8
1.2.2 Filling Paragraphs 8
1.2.3 Removing Existing Indentation 8
1.2.4 Combining Dedent and Fill 9
1.2.5 Indenting Blocks 10
1.2.6 Hanging Indents 12
1.2.7 Truncating Long Text 12
1.3 re: Regular Expressions 13
1.3.1 Finding Patterns in Text 14
1.3.2 Compiling Expressions 15
1.3.3 Multiple Matches 16
1.3.4 Pattern Syntax 17
1.3.5 Constraining the Search 28
1.3.6 Dissecting Matches with Groups 30
1.3.7 Search Options 36
1.3.8 Looking Ahead or Behind 44
1.3.9 Self-referencing Expressions 48
1.3.10 Modifying Strings with Patterns 53
1.3.11 Splitting with Patterns 55
1.4 difflib: Compare Sequences 58
1.4.1 Comparing Bodies of Text 58
1.4.2 Junk Data 61
1.4.3 Comparing Arbitrary Types 62
ix
x Contents
Index 1375
Introduction
Distributed with every copy of Python, the standard library contains hundreds of modules
that provide tools for interacting with the operating system, interpreter, and Internet—all
of them tested and ready to be used to jump-start the development of your applications.
This book presents selected examples demonstrating how to use the most commonly used
features of the modules that support Python’s “batteries included” slogan, taken from the
popular Python Module of the Week (PyMOTW) blog series.
Python 3 Versus 2
The Python community is currently undergoing a transition from Python version 2 to
Python version 3. As the major version number change implies, there are many incompati-
bilities between Python 2 and 3, and not just in the language. Quite a few of the standard
library modules have been renamed or otherwise reorganized in Python 3.
The Python development community recognized that those incompatibilities would
require an extended transition period, while the ecosystem of Python libraries and tools
was updated to work with Python 3. Although many projects still rely on Python 2, it is
xxxi
xxxii Introduction
only receiving security updates and is scheduled to be completely deprecated by 2020. All
new-feature work is happening in the Python 3 releases.
It can be challenging, though not impossible, to write programs that work with both
versions. Doing so often requires examining the version of Python under which a program
is running and using different module names for imports or different arguments to classes
or functions. A variety of tools, available outside of the standard library, can simplify this
process. To keep the examples in this book as concise as possible, while still relying only on
the standard library, they are focused on Python 3. All of the examples have been tested
under Python 3.5 (the current release of the 3.x series at the time they were written), and
may not work with Python 2 without modification. For examples designed to work with
Python 2, refer to the Python 2 edition of the book, called The Python Standard Library
by Example.
In an effort to maintain clear and concise descriptions for each example, the differences
between Python 2 and 3 are not highlighted in each chapter. The Porting Notes appendix
summarizes some of the biggest differences between these versions, and is organized to be
useful as an aid when porting from Python 2 to 3.
Register your copy of The Python 3 Standard Library by Example at informit.com for
convenient access to downloads, updates, and corrections as they become available. To
start the registration process, go to informit.com/register and log in or create an account.
Enter the product ISBN (9780134291055) and click Submit. Once the process is complete,
you will find any available bonus content under “Registered Products.”
Acknowledgments
This book would not have come into being without the contributions and support of many
other people.
I was first introduced to Python around 1997 by Dick Wall, while we were working
together on GIS software at ERDAS. I remember being simultaneously happy that I had
found a new tool language that was so easy to use, and sad that the company did not let
us use it for “real work.” I have used Python extensively at all of my subsequent jobs, and I
have Dick to thank for the many happy hours I have spent working on software since then.
The Python core development team has created a robust ecosystem of language, tools,
and libraries that continue to grow in popularity and find new application areas. Without
the continued investment in time and resources they have given us, we would all still be
spending our energy reinventing wheel after wheel.
The material in this book started out as a series of blog posts. Without the exceptionally
positive response of the readers of the blog, those articles would never have been updated
to work with Python 3, and this new book would not exist. Each of those posts has been
reviewed and commented on by members of the Python community, with corrections, sug-
gestions, and questions that led to the refinements and improvements that appear in this
book. Thank you all for reading along week after week, and contributing your time and
attention.
The technical reviewers for the book—Diana Clarke, Ian Cordasco, Mark McClain, Paul
McLanahan, and Ryan Petrello—spent many hours looking for issues with the example code
and accompanying explanations. Thanks to their diligence, the resulting text is stronger
than I could have produced on my own.
Jim Baker provided helpful insight when documenting the readline module, especially
by pointing out the gnureadline package for platforms where GNU libraries are old or not
installed by default.
Patrick Kettner helped to collect the output for the platform module examples on
Windows.
A special thanks goes to the editors, production staff, and marketing team at Addison-
Wesley for all of their hard work and assistance in helping me realize my vision for this
book and make it a success.
Finally, I want to thank my wife, Theresa Flynn, who has gracefully accepted all of the
lost nights and weekends over the course of this new project. Thank you for your advice,
encouragement, and support.
xxxiii
This page intentionally left blank
About the Author
Doug Hellmann is currently employed by Red Hat to work
on OpenStack. He is on the OpenStack Technical Committee
and contributes to many aspects of the project. He has been
programming in Python since version 1.4, and has worked on
a variety of Unix and non-Unix platforms for projects in fields
such as mapping, medical news publishing, banking, and data
center automation. Doug is a Fellow of the Python Software
Foundation, and served as its Communications Director from
2010 to 2012. After a year as a regular columnist for Python
Magazine, he served as Editor-in-Chief from 2008 to 2009.
Between 2007 and 2011, Doug published the popular Python Module of the Week series
on his blog, and an earlier version of this book for Python 2 called The Python Standard
Library by Example. He lives in Athens, Georgia.
xxxv
This page intentionally left blank
Chapter 1
Text
The str class is the most obvious text processing tool available to Python programmers, but
there are plenty of other tools in the standard library to make advanced text manipulation
simple.
Programs may use string.Template as a simple way to parameterize strings beyond
the features of str objects. While not as feature-rich as templates defined by many of
the web frameworks or extension modules available from the Python Package Index,
string.Template is a good middle ground for user-modifiable templates in which dynamic
values need to be inserted into otherwise static text.
The textwrap (page 7) module includes tools for formatting text from paragraphs by
limiting the width of output, adding indentation, and inserting line breaks to wrap lines
consistently.
The standard library includes two modules for comparing text values that go beyond
the built-in equality and sort comparison supported by string objects. re (page 13) provides
a complete regular expression library, implemented in C for speed. Regular expressions
are well suited for finding substrings within a larger data set, comparing strings against a
pattern more complex than another fixed string, and mild parsing.
difflib (page 58), in contrast, computes the actual differences between sequences of text
in terms of the parts added, removed, or changed. The output of the comparison functions
in difflib can be used to provide more detailed feedback to the user about where changes
occur in two inputs, how a document has changed over time, and so on.
1.1.1 Functions
The function capwords() capitalizes all of the words in a string.
1
2 Chapter 1 Text
print(s)
print(string.capwords(s))
The results are the same as those obtained by calling split(), capitalizing the words in
the resulting list, and then calling join() to combine the results.
$ python3 string_capwords.py
1.1.2 Templates
String templates were added as part of PEP 2921 and are intended as an alternative to the
built-in interpolation syntax. With string.Template interpolation, variables are identified
by prefixing the name with $ (e.g., $var). Alternatively, if necessary to set them off from
surrounding text, they can be wrapped with curly braces (e.g., ${var}).
This example compares a simple template with similar string interpolation using the %
operator and the new format string syntax using str.format().
t = string.Template("""
Variable : $var
Escape : $$
Variable in text: ${var}iable
""")
print('TEMPLATE:', t.substitute(values))
s = """
Variable : %(var)s
Escape : %%
Variable in text: %(var)siable
"""
print('INTERPOLATION:', s % values)
s = """
Variable : {var}
Escape : {{}}
1 www.python.org/dev/peps/pep-0292
1.1 string: Text Constants and Templates 3
print('FORMAT:', s.format(**values))
In the first two cases, the trigger character ($ or %) is escaped by repeating it twice. For the
format syntax, both { and } need to be escaped by repeating them.
$ python3 string_template.py
TEMPLATE:
Variable : foo
Escape : $
Variable in text: fooiable
INTERPOLATION:
Variable : foo
Escape : %
Variable in text: fooiable
FORMAT:
Variable : foo
Escape : {}
Variable in text: fooiable
One key difference between templates and string interpolation or formatting is that the
type of the arguments is not taken into account. The values are converted to strings, and
the strings are inserted into the result. No formatting options are available. For example,
there is no way to control the number of digits used to represent a floating-point value.
A benefit, though, is that use of the safe_substitute() method makes it possible
to avoid exceptions if not all of the values needed by the template are provided as
arguments.
try:
print('substitute() :', t.substitute(values))
except KeyError as err:
print('ERROR:', str(err))
print('safe_substitute():', t.safe_substitute(values))
4 Chapter 1 Text
Since there is no value for missing in the values dictionary, a KeyError is raised by
substitute(). Instead of raising the error, safe_substitute() catches it and leaves the
variable expression alone in the text.
$ python3 string_template_missing.py
ERROR: 'missing'
safe_substitute(): foo is here but $missing is not provided
class MyTemplate(string.Template):
delimiter = '%'
idpattern = '[a-z]+_[a-z]+'
template_text = '''
Delimiter : %%
Replaced : %with_underscore
Ignored : %notunderscored
'''
d = {
'with_underscore': 'replaced',
'notunderscored': 'not replaced',
}
t = MyTemplate(template_text)
print('Modified ID pattern:')
print(t.safe_substitute(d))
In this example, the substitution rules are changed so that the delimiter is % instead of
$ and variable names must include an underscore somewhere in the middle. The pattern
%notunderscored is not replaced by anything, because it does not include an underscore
character.
$ python3 string_template_advanced.py
Modified ID pattern:
1.1 string: Text Constants and Templates 5
Delimiter : %
Replaced : replaced
Ignored : %notunderscored
For even more complex changes, it is possible to override the pattern attribute and define
an entirely new regular expression. The pattern provided must contain four named groups
for capturing the escaped delimiter, the named variable, a braced version of the variable
name, and invalid delimiter patterns.
t = string.Template('$var')
print(t.pattern.pattern)
The value of t.pattern is a compiled regular expression, but the original string is available
via its pattern attribute.
\$(?:
(?P<escaped>\$) | # Two delimiters
(?P<named>[_a-z][_a-z0-9]*) | # Identifier
{(?P<braced>[_a-z][_a-z0-9]*)} | # Braced identifier
(?P<invalid>) # Ill-formed delimiter exprs
)
This example defines a new pattern to create a new type of template, using {{var}} as the
variable syntax.
class MyTemplate(string.Template):
delimiter = '{{'
pattern = r'''
\{\{(?:
(?P<escaped>\{\{)|
(?P<named>[_a-z][_a-z0-9]*)\}\}|
(?P<braced>[_a-z][_a-z0-9]*)\}\}|
(?P<invalid>)
)
'''
t = MyTemplate('''
{{{{
6 Chapter 1 Text
{{var}}
''')
print('MATCHES:', t.pattern.findall(t.template))
print('SUBSTITUTED:', t.safe_substitute(var='replacement'))
Both the named and braced patterns must be provided separately, even though they are
the same. Running the sample program generates the following output:
$ python3 string_template_newsyntax.py
1.1.4 Formatter
The Formatter class implements the same layout specification language as the format()
method of str. Its features include type coersion, alignment, attribute and field references,
named and positional template arguments, and type-specific formatting options. Most of the
time the format() method is a more convenient interface to these features, but Formatter
is provided as a way to build subclasses, for cases where variations are needed.
1.1.5 Constants
The string module includes a number of constants related to ASCII and numerical character
sets.
def is_str(value):
return isinstance(value, str)
These constants are useful when working with ASCII data, but since it is increas-
ingly common to encounter non-ASCII text in some form of Unicode, their application is
limited.
1.2 textwrap: Formatting Text Paragraphs 7
$ python3 string_constants.py
ascii_letters='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW
XYZ'
ascii_lowercase='abcdefghijklmnopqrstuvwxyz'
ascii_uppercase='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
digits='0123456789'
hexdigits='0123456789abcdefABCDEF'
octdigits='01234567'
printable='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ
RSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c'
punctuation='!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
whitespace=' \t\n\r\x0b\x0c'
TIP
Related Reading
2 https://docs.python.org/3.5/library/string.html
3 https://docs.python.org/3/library/stdtypes.html#string-methods
4 www.python.org/dev/peps/pep-0292
5 https://docs.python.org/3.5/library/string.html#format-string-syntax
8 Chapter 1 Text
print(textwrap.fill(sample_text, width=50))
The results are something less than desirable. The text is now left justified, but the first
line retains its indent and the spaces from the front of each subsequent line are embedded
in the paragraph.
$ python3 textwrap_fill.py
dedented_text = textwrap.dedent(sample_text)
print('Dedented:')
print(dedented_text)
$ python3 textwrap_dedent.py
Dedented:
Since “dedent” is the opposite of “indent,” the result is a block of text with the common
initial whitespace from each line removed. If one line is already indented more than another,
some of the whitespace will not be removed.
Input like
Line one.
Line two.
Line three.
becomes
Line one.
Line two.
Line three.
dedented_text = textwrap.dedent(sample_text).strip()
for width in [45, 60]:
print('{} Columns:\n'.format(width))
10 Chapter 1 Text
print(textwrap.fill(dedented_text, width=width))
print()
$ python3 textwrap_fill_width.py
45 Columns:
60 Columns:
dedented_text = textwrap.dedent(sample_text)
wrapped = textwrap.fill(dedented_text, width=50)
wrapped += '\n\nSecond paragraph after a blank line.'
final = textwrap.indent(wrapped, '> ')
print('Quoted block:\n')
print(final)
The block of text is split on newlines, the prefix is added to each line that contains text,
and then the lines are combined back into a new string and returned.
$ python3 textwrap_indent.py
Quoted block:
1.2 textwrap: Formatting Text Paragraphs 11
To control which lines receive the new prefix, pass a callable as the predicate argument to
indent(). The callable will be invoked for each line of text in turn and the prefix will be
added for lines where the return value is true.
def should_indent(line):
print('Indent {!r}?'.format(line))
return len(line.strip()) % 2 == 0
dedented_text = textwrap.dedent(sample_text)
wrapped = textwrap.fill(dedented_text, width=50)
final = textwrap.indent(wrapped, 'EVEN ',
predicate=should_indent)
print('\nQuoted block:\n')
print(final)
This example adds the prefix EVEN to lines that contain an even number of characters.
$ python3 textwrap_indent_predicate.py
Quoted block:
dedented_text = textwrap.dedent(sample_text).strip()
print(textwrap.fill(dedented_text,
initial_indent='',
subsequent_indent=' ' * 4,
width=50,
))
This ability makes it possible to produce a hanging indent, where the first line is indented
less than the other lines.
$ python3 textwrap_hanging_indent.py
The indent values can include non-whitespace characters, too. The hanging indent can be
prefixed with * to produce bullet points, for example.
dedented_text = textwrap.dedent(sample_text)
original = textwrap.fill(dedented_text, width=50)
print('Original:\n')
print(original)
Other documents randomly have
different content
footman in his brown livery assisted her into the carriage.
Then she smiled merrily, and bowed as I raised my hat, and
she was borne away westward in the stream of fine
equipages, hers the smartest of them all.
We all laughed.
Mrs Anson, for once, did not agree with this sweeping
condemnation, while Mabel declared that she always
enjoyed the fun of the battles of flowers and paper confetti,
although she admitted that she had never had the courage
to go out on those days when the pellets of lime, or “harp
confetti,” are permitted. Both Hickman and myself
supported Mabel in defence of the annual fêtes at Nice as
being unique in all the world.
“So, so. One season I won five thousand francs. In fact, I’ve
never lost on the whole season. I’ve always left the Riviera
with some of the bank’s money.”
Upon that very couch I had reclined while the foul tragedy
had been enacted in that room. My head swam; I closed my
eyes. The great gilt clock, with its pendulum representing
the figure of a girl swinging beneath the trees, standing on
the mantelshelf, ticked out low and musically, just as it had
done on that fateful night. In an instant, as I sat with head
turned from my companions and my eyes shut, the whole of
that tragic scene was re-enacted. I heard the crash, the
woman’s scream, the awe-stricken exclamation that
followed in the inner room. I heard, too, the low swish of a
woman’s skirts, the heavy blow struck by an assassin’s
hand, and in horror felt the warm life-blood of the unknown
victim as it trickled upon my hand.
Mabel suddenly ran her white fingers over the keys, and the
music brought me back to a realisation of my true position.
I had at length discovered the actual house in which the
mysterious tragedy had been enacted, and it became
impressed upon me that by the exercise of greatest care I
might further be enabled to prosecute secret investigations
to a successful issue, and at length solve the enigma.
At the end of the room, too, were the folding doors, now
concealed by curtains. It was through those very doors that
Edna, my mysterious protectress, had passed and repassed
to that inner room whence had come the sound of
champagne being uncorked and the woman’s piercing
scream.
As she gossiped with me, now and then waving her big
feather fan, she conveyed to my mind an impression of
extreme simplicity in the midst of the most wonderful
complexity. She seemed to take the peculiar traits from
many characters, and so mingle them that, like the
combination of hues in a sunbeam, the effect was as one to
the eye. I had studied her carefully each time we had met,
and had found that she had something of the romantic
enthusiasm of a Juliet, of the truth and constancy of a
Helen, of the dignified purity of an Isabel, of the tender
sweetness of a Viola, of the self-possession and intellect of
a Portia—combined together so equally and so
harmoniously that I could scarcely say that one quality
predominated over the other. Her dignity was imposing, and
stood rather upon the defensive; her submission, though
unbounded, was not passive, and thus she stood wholly
distinct in her sweetness from any woman I had ever met.
The following day was one on which she was due to take
her music-lesson, and I inquired whether I might, as usual,
meet her and escort her across the Park.
“You are really very kind,” she responded; “but I fear I take
up far too much of your time.”
“But you’ll write and tell me when you are free?” I urged
earnestly.
All the time I was longing to get a sight of the interior of the
adjoining apartment, the room whence had burst forth that
woman’s agonised cry in the stillness of the night. I racked
my brain to find some means of entering there, but could
devise none. A guest can hardly wander over his hostess’s
house on the first occasion he receives an invitation.
Besides, to betray any interest in the house might, I
reflected, arouse some suspicion. To be successful in these
inquiries would necessitate the most extreme caution.
The gilt clock with its swinging girl had already struck
eleven on its silver bell, and been re-echoed by another
clock in the hall playing the Westminster chimes, when
suddenly Mrs Anson, with a book in her hand, looked across
to her daughter, saying—
“The library is the next room, there. You’ll find them on the
writing-table. Mother always leaves them there. It’s really
too bad to thus make a servant of you. I’ll ring for Arnold.”
“No, no,” I protested, and at once went eagerly in search of
them.
Chapter Sixteen.
The Inner Room.
The glasses were, as Mrs Anson had said, lying beside the
blotting-pad upon a small rosewood writing-table. I took
them up, and, having made a tour of inspection, was about
to leave the place, when suddenly, on the top of some
books upon a shelf close to the door, I espied a small
volume.
“Your mother tells me that you have a box for the Prince of
Wales’s on Saturday night, and has asked me to join you,” I
said. Her eyes brightened, and I saw that she was delighted
at the prospect. But she expressed a hope that I wouldn’t
be bored.
The night was bright and starlit, and the air refreshing.
Turning to the left after leaving the house, we came
immediately to a road which gave entrance to that secluded
oval called The Boltons. I looked at the name-plate, and
saw it was named Gilston Road. It must have been at this
corner that I had been knocked down by a passing cab
when, on my first adventurous journey alone, I had
wandered so far westward.
“Excellent.”
“Who were the men with whom she had the minor love-
affairs—any one I know?” I inquired.
“I think not, because it all occurred before they returned to
live in England,” he answered.
We had passed from the Fulham Road into the King’s Road,
Chelsea, and at that moment he halted suddenly at the
corner of a street of high, regularly built houses, most of
which were in darkness, saying—“I live down here. Come in
and have a final whisky and soda with me; then you can
take a cab back to the Strand. There are cabs all night on
the rank in Sloane Square.”
ebookbell.com