Instant download Python for the busy java developer: the language, syntax, and ecosystem 1st edition

Page 1


Visit to download the full and correct content document: https://textbookfull.com/product/python-for-the-busy-java-developer-the-language-syn tax-and-ecosystem-1st-edition-deepak-sarda-auth/

More products digital (pdf, epub, mobi) instant download maybe you interests ...

Biota

Grow 2C gather 2C cook Loucas

https://textbookfull.com/product/biota-grow-2c-gather-2c-cookloucas/

Microorganisms for Green Revolution Volume 2 Microbes for Sustainable Agro ecosystem 1st Edition Deepak G. Panpatte

https://textbookfull.com/product/microorganisms-for-greenrevolution-volume-2-microbes-for-sustainable-agro-ecosystem-1stedition-deepak-g-panpatte/

Java EE Development with Eclipse 1st Edition Vohra Deepak

https://textbookfull.com/product/java-ee-development-witheclipse-1st-edition-vohra-deepak/

Java quick syntax reference Second Edition Olsson

https://textbookfull.com/product/java-quick-syntax-referencesecond-edition-olsson/

Haskell Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library 1st Edition Stefania Loredana Nita

https://textbookfull.com/product/haskell-quick-syntax-referencea-pocket-guide-to-the-language-apis-and-library-1st-editionstefania-loredana-nita/

C++17 quick syntax reference: apocket guide to the language, apis and library 2 edition Edition Olsson

https://textbookfull.com/product/c17-quick-syntax-referenceapocket-guide-to-the-language-apis-and-library-2-edition-editionolsson/

C++17 quick syntax reference: a pocket guide to the language, APIs and library Third Edition Olsson

https://textbookfull.com/product/c17-quick-syntax-reference-apocket-guide-to-the-language-apis-and-library-third-editionolsson/

C# 7 Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library Mikael Olsson

https://textbookfull.com/product/c-7-quick-syntax-reference-apocket-guide-to-the-language-apis-and-library-mikael-olsson/

Python Natural Language Processing Advanced machine learning and deep learning techniques for natural language processing 1st Edition Jalaj Thanaki

https://textbookfull.com/product/python-natural-languageprocessing-advanced-machine-learning-and-deep-learningtechniques-for-natural-language-processing-1st-edition-jalaj-

Python for the Busy Java Developer

The Language, Syntax, and Ecosystem

Deepak Sarda

Python for the Busy Java Developer

The Language, Syntax, and Ecosystem

Deepak Sarda

Python for the Busy Java Developer

Deepak Sarda

Singapore, Singapore

ISBN-13 (pbk): 978-1-4842-3233-0

ISBN-13 (electronic): 978-1-4842-3234-7 https://doi.org/10.1007/978-1-4842-3234-7

Library of Congress Control Number: 2017960940

Copyright © 2017 by Deepak Sarda

This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.

Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.

The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.

While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.

Cover image designed by Freepik

Managing Director: Welmoed Spahr

Editorial Director: Todd Green

Acquisitions Editor: Todd Green

Development Editor: James Markham

Technical Reviewer: Chaim Krause

Coordinating Editor: Jill Balzano

Copy Editor: Kim Burton weisman

Compositor: SPi Global

Indexer: SPi Global Artist: SPi Global

Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.

For information on translations, please e-mail rights@apress.com, or visit http://www.apress. com/rights-permissions.

Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales.

Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book’s product page, located at www.apress.com/9781484232330. For more detailed information, please visit http://www.apress.com/source-code.

Printed on acid-free paper

About the Author

Deepak Sarda has been working as a software developer for more than twelve years, in multiple business domains and in a variety of technologies. He has worked on several highperformance, server-side applications written in Java, and has done web development and systems automation work in Python. He lives in Singapore with his lovely wife and their adorable daughters. He can be found online at antrix.net or @antrix on Twitter.

He’d love to hear what you’ve to say about this book. Please email him at deepak@antrix.net.

About the Technical Reviewer

Chaim Krause is an expert computer programmer with over 30 years of experience to prove it. He has worked as a lead tech support engineer for ISPs as early as 1995, as a senior developer support engineer with Borland for Delphi, and has worked in Silicon Valley for over a decade in various roles, including technical support engineer and developer support engineer. He is currently a military simulation specialist for the US Army’s Command and General Staff College, working on projects such as developing serious games for use in training exercises. He has also authored several video training courses on Linux topics and has been a technical reviewer on more than 20 books, including iOS Code Testing by Abhishek Mishra (Apress, 2017), Android Apps for Absolute Beginners by Wallace Jackson (Apress, 2017), and C# and XML Primer: XML Essentials for C# and .NET Development by Jonathan Hartwell (Apress, 2017). It seems only natural that he would be an avid gamer and have his own electronics lab and server room in his basement. He currently resides in Leavenworth, Kansas, with his loving partner, Ivana, and a menagerie of four-legged companions: their two dogs, Dasher and Minnie, and their three cats, Pudems, Talyn, and Alaska.

Acknowledgments

I’d always heard it being said, but only now do I truly realize it: writing a book is hard work! It would have been harder still had it not been for the support from my family and friends.

I wish to especially thank Hitesh Sarda, Rohit Sharma, and Srijith Nair for the incredibly detailed and thoughtful feedback that they provided as I wrote this book. I owe many thanks to them.

I must also acknowledge the constant encouragement that I received from my wife, Sonika. I can’t thank her enough for her patience and support as I took time out to write this book.

Introduction

Hello There!

If you are reading this book, then chances are that you are a busy Java developer who is interested in learning Python. If so, I hope that by the time you are done reading this short book.

• You will have gained sufficient familiarity with the Python language syntax so that you’re able to read some code and understand what it is doing.

• You will have had enough orientation to be able to navigate the Python ecosystem of libraries and tools.

This book is not for the beginner programmer. I assume that you are comfortable programming in Java (or a similar language like C#), and hence, I will not bore you with explanations of basic concepts like variables, functions, and classes.

About the Book

This book is divided into three broad chapters:

• The Language

• The Syntax

• The Ecosystem

In the first chapter, we take a brief look at the Python language and learn what it has to offer. Next, we’ll get down to the details of the syntax before wrapping up with a look at the wider ecosystem surrounding the Python language.

CHAPTER 1

The Language

Let’s start our Python journey by first gaining an understanding of what Python has to offer that’s different from Java. I’ll then help you get setup with Python before we dive into the language’s syntax in the next chapter.

What Is Python?

Python is an “open source, general-purpose programming language that is dynamic, strongly typed, object-oriented, functional, memory-managed, and fun to use.” Those are a lot of adjectives for one sentence! Let’s unpack them one at a time.

Python is distributed under an open source, BSD-style license called the Python Software Foundation License Agreement. It is a very permissive license that allows great flexibility in how Python can be used. Python’s development is done in the open by a large and diverse community of volunteers.

Python is general purpose in that you can use it to build a variety of applications running the gamut from simple scripts and commandline tools to desktop and web applications, network servers, scientific applications, and more.

We know that Java is a statically typed language; that is, the types are checked and enforced at compile time. In contrast, Python is dynamic, which means that the types are checked only at runtime. But Python is

© Deepak Sarda 2017

D. Sarda, Python for the Busy Java Developer, https://doi.org/10.1007/978-1-4842-3234-7_1

Chapter 1 the Language

also strongly typed, just like Java. You can only execute operations that are supported by the target type.

Another way to think about this is that in Java, both variables and objects have types associated with them; whereas in Python, only objects have types, not the variables that they are bound to. In Java, when we declare

MyType obj = new MyType()

The obj variable is declared of type MyType and then the newly instantiated object of type MyType is assigned to it. In contrast, in Python, the same declaration would read

obj = MyType()

Ignoring the missing new keyword (which Python doesn’t have), obj is simply a name that is bound to the object on the right, which happens to be of type MyType. We can even reassign obj in the very next line—obj = MyOtherType()—and it wouldn’t be a problem. In Java, this reassignment would fail to compile1 while in Python, the program will run and will only fail at runtime if we try to execute an operation via obj that is incompatible with the type assigned to it at that point in time.

Python is object oriented and supports all the standard OOP features that Java has like creation of types using classes, encapsulation of state, inheritance, polymorphism, and so forth. It even goes beyond Java and supports features such as multiple inheritance, operator overloading, meta-programming, and so forth.

Python also supports a rich set of functional programming features and idioms. In Python, functions are first-class objects that can be created, manipulated, and passed around just like any other object. While its emphasis on functional programming might not be as focused as say

1Unless MyOtherType happens to be a subclass of MyType.

Chapter 1 the Language

Clojure, Python certainly offers much more to the functional programmer than Java.2

Another similarity between the languages is in terms of manual memory management, in that there is none. The language runtime takes care of correctly allocating and freeing up memory, saving the programmer from the drudgery—and mistakes—of manually managing memory. Having said that, the JVM garbage collectors are much, much better performing than the Python GC. This can become a concern depending on the type of application you are building.

Finally, and above all, Python is fun and a joy to use. This is a strong claim to make but I hope that by the time you are done reading this book, you’ll agree with me and the millions of other Python programmers out there!

History

Python is the brainchild of a Dutch programmer named Guido van Rossum. He started working on it when he got frustrated with the ABC language in the late 1980s and after some years of private development, he released the first version of Python in 1994. This actually makes Python older than Java, the first version of which was released in 1996, a full two years later! A comparison of the two languages is shown in Table 1-1.

2Even after the introduction of lambdas in Java 8.

Table

1-1. Historical comparison of Java and Python

James gosling guido van rossum

From C++/Oak From aBC

1.0 - Jan 1996

9.0 - Sep 2017

1.0 - Jan 1994

3.6 - Dec 2016

JSr pep

Commercial Community

Note I’ll use this tabular format to compare and contrast python and Java whenever it makes sense.

Since then, the language has continued to refine and evolve, with Python 2.0 being released in 2000. As of this writing, the 2.x versions are the most widely deployed.

In version 3.0, the language designers decided to break backward compatibility in order to clean up some of the accumulated language warts. Although this has been good from a language perspective, it has been a significant hindrance to those upgrading from 2.x to 3.x. Imagine if Sun had decided to introduce generics in Java 5 without type erasure, thus breaking backward compatibility. The Java language would’ve been much nicer today but the transition period would’ve been difficult, to say the least. That is the kind of transition the Python user community is going through right now.

Note Since 2.x is still the most widely used version of python, this book will cover python 2.x fea tures and syntax, calling out any differences with 3.x from time to time.

From the outset, Python’s development has been done in the open with a community of volunteers contributing to the language and the core libraries. Any language changes are proposed and discussed through a process called PEP (Python Enhancement Proposals), with Guido having final say in deciding the outcome. For his stewardship and continuous involvement in the development of Python, Guido is affectionately called the “Benevolent Dictator For Life.” He also periodically writes a Python History blog3 chronicling the evolution of various language features.

Installation

This book is full of example code, and the best way to follow along is to actually try these examples by yourself. To do this, you’ll obviously need to install Python on your system. But an easier way is to check if you already have access to a system with Python installed! Almost all systems running Linux should have Python preinstalled. Recent versions of Mac OS X also come with Python preinstalled. Just open a command shell on either of these two systems and type in python. If you get a Python shell prompt, you are all set! The version of Python installed may be a bit outdated but it should be sufficient to get started.

3http://python-history.blogspot.com/ Chapter 1 the Language

Chapter 1 the Language

Tip as a lightweight alterna tive, you can try an online python environment, such as http://repl.it/. the examples in this book are all simple enough to work there.

Tools

Python source code is organized in files with a .py extension. The python executable interprets the source code and translates it into a Python language–specific bytecode that is stored in .pyc files. This bytecode is then executed by the Python virtual machine, which is also invoked by the same python executable. Although this sounds like two steps, in reality, it is just one step with the bytecode generation happening on the fly. This is in contrast to Java (see Table 1-2), where the responsibilities for the parsing and compilation of source code and the actual execution of the compiled bytecode are split between javac and java respectively. In Python, the python executable handles both steps. In fact, .pyc files are, in effect, just intermediate caches to hold the translated bytecode. They are not strictly necessary for execution. If you deleted the .pyc files, they’d simply be regenerated the next time you ran the .py files.

Table 1-2. Comparison of Tools

Java.exe + javac.exepython.exe

IntelliJ IDea pyCharm

eclipse JDt pyDev

Java 9 JShell repL

Chapter 1 the Language

There are multiple IDEs available for writing Python code. PyDev, based on the Eclipse framework, and PyCharm, based on the IntelliJ IDEA framework, are two of the more popular choices. While having an IDE is nice, it is perfectly feasible to write Python code using a plain text editor such as Vim4 or Sublime Text.

One interesting feature of Python that’s missing in Java is the REPL, short for Read Eval Print Loop. A quick demo would be useful here. If you’ve got access to a Python installation (follow the instructions in the “Installation” section of this chapter), go ahead and launch a python shell, as follows:

antrix@dungeon:~$ python

Python 2.7.5+ (default, Feb 27 2014, 19:39:55) [GCC 4.8.1] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>>

When you run the python executable in this manner, it starts up in an interactive mode. The first few lines contain information such as the version and the underlying operating system. After that, you are presented with the >>> prompt. This is where all your interaction with Python will occur. The python shell is running a loop, which will read everything that you type in at this prompt, evaluate what it has read, and then print the result. Thus the name, REPL.

Let’s try it out:

>>> 10 + 10

20

>>>

4Yes, Emacs is fine too.

We typed in 10 + 10 at the prompt and hit the Enter key. The Python REPL read this value, evaluated it, and printed the result. Then it went back to the prompt to wait for our next input. Let’s try the following variable assignment:

>>> x = 10

In this case, we didn’t see any output because what we entered was just a statement, not an expression. But it did modify the state of the python shell. If we query for x again, we’ll find this: >>> x = 10

Let’s call one of the built-in functions named help. >>> help(x)

Help on int object: class int(object)

| int(x=0) -> int or long | int(x, base=10) -> int or long |

| Convert a number or string to an integer, or return 0 if no arguments are given :q

Calling help on any object brings up a paged view of what is, effectively, the Javadoc for the object’s class. To exit the help view, just type q at the : prompt and you’ll be back at the >>> prompt.

Chapter 1 the Language

The full documentation view for an object can be quite verbose. If you just want a quick overview of what attributes an object supports, use the dir function.

>>> dir(x)

['__abs__', '__add__', '__and__', '__class__', '__cmp__', '__ coerce__', '__delattr__', '__div__', '__divmod__', '__doc__', '__float__', '__floordiv__', '__format__', '__getattribute__', '__getnewargs__', '__hash__', '__hex__', '__index__', '__ init__', '__int__', '__invert__', '__long__', '__lshift__', '__mod__', '__mul__', '__neg__', '__new__', '__nonzero__', '__ oct__', '__or__', '__pos__', '__pow__', '__radd__', '__rand__', '__rdiv__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__ repr__', '__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__', '__ror__', '__rpow__', '__rrshift__', '__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', '__ trunc__', '__xor__', 'bit_length', 'conjugate', 'denominator', 'imag', 'numerator', 'real']

Ignoring the funky double-underscores for now, what dir(x) returned is effectively a directory of all the attributes available on the object. You can access any of them using the . (dot) syntax.

>>> x.numerator

>>> x.denominator

>>> x.conjugate

<built-in method conjugate of int object at 0x9e9a274>

Chapter 1 the Language

>>> x.conjugate()

You can also use the dir() function without any argument to get a list of built-ins.

>>> dir()

['__builtins__', '__doc__', '__name__', '__package__']

>>> dir(__builtins__)

['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'BufferError', 'BytesWarning', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'EnvironmentError', 'Exception', 'False', 'FloatingPointError', 'FutureWarning', 'GeneratorExit', 'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError', 'None', 'NotImplemented', 'NotImplementedError', 'OSError', 'OverflowError', 'PendingDeprecationWarning', 'ReferenceError'ror', 'RuntimeError', 'RuntimeWarning', 'StandardError', 'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError', 'True', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserWarning', 'ValueError', 'Warning', 'ZeroDivisionError', '_', '__debug__', '__doc__', '__import__', '__name__', '__package__', 'abs', 'all', 'any', 'apply', 'basestring', 'bin', 'bool', 'buffer', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod', 'cmp', 'coerce', 'compile', 'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile', 'exit', 'file',

Chapter 1 the Language

'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'intern', 'isinstance', 'issubclass', 'iter', 'len', 'license', 'list', 'locals', 'long', 'map', 'max', 'memoryview', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'quit', 'range', 'raw_input', 'reduce', 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode', 'vars', 'xrange', 'zip']

This gives a list of functions and other objects that are built-in and do not have to be imported from other packages. This is analogous to how everything defined in the java.lang package is available everywhere in Java without having to explicitly import it.

Tip the dir and help functions are extremely useful when doing exploratory development in a python interactive shell.

There’s one last thing I wish to show before we wrap up this section. Let’s create a new file named hello.py with the following contents:

print "Hello There!"

x = 10 + 10

print "The value of x is", x

Now execute python, passing in this file as an argument:

antrix@dungeon:~$ python hello.py

Hello There!

The value of x is 20

antrix@dungeon:~$

Chapter 1 the Language

This is more along the lines of a traditional development process: write code in a file and then execute that file. This also demonstrates how the python executable combines the role of javac and java in one process.

With that brief demo of Python, we are ready to explore the language’s syntax.

Summary

In this chapter, we learned that Python is not just a scripting language but a general-purpose programming language with a long history behind it. We then got familiar with the python executable, the Python counterpart of the java and javac executables.

We also looked at the Python REPL environment, which is a great way to interactively try out Python. If you still don’t have the REPL set up, I urge you to do so now because the next chapter makes extensive use of it as we dive into the nitty-gritty details of the language’s syntax!

CHAPTER 2 The Syntax

This chapter is the heart of the book. It is a deep dive into Python language features. I explain them using short code fragments that you can easily try out yourself.

We start by introducing the basic data types and built-in collections such as dictionaries and sets, with a special emphasis on lists. We’ll then dive into functions and discover their power as a first-class language feature.

Moving on to classes, we’ll find out how flexible Python is as an object-oriented language, especially compared to Java. We’ll then explore protocols, which extend the language’s syntax to your own types.

Finally, we’ll discuss the concepts of modules and packages as a means of organizing Python code.

As you can see, it is going to be a long chapter. So grab some coffee and let’s get started!

Hello World

>>> print "Hello World" Hello World >>>

Well, that was easy! Moving on …

© Deepak Sarda 2017

D. Sarda, Python for the Busy Java Developer, https://doi.org/10.1007/978-1-4842-3234-7_2

ChaPter 2 the Syntax

Tip In Python 3, the print keyword has been replaced with the print() function.

Basic Constructs

Here’s a bit of Python code that, well, I don’t have to tell you what it does, do I? Most Python code is like this: eminently readable and almost pseudo-code-like.

>>> numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]

>>> odd_numbers = []

>>> # What are the odds?

>>> for num in numbers:

... if num % 2 != 0:

... odd_numbers.append(num)

...

>>> print "the odd numbers are:", odd_numbers ⑦ the odd numbers are: [1, 3, 5, 7, 9] >>>

You must have noticed a few things, such as the lack of semicolons as statement separators. Let’s work through this code one line at a time to see what else is new and different compared to Java.

1. In the first line, we are declaring a list of numbers. Lists are one of the built-in data structures in Python, along with tuples, dicts, and sets. Notice that we didn’t declare any types nor did we use any new keyword to allocate the list.

2. Next, we declare another list, named odd_numbers, which is initialized empty.

3. Moving further down, we find a comment starting with the # token. Comments extend to the end of line, just like they do in Java with the // token.

4. Here, we come upon a for loop, which should remind you of a more English version of Java’s foreach loop. Block scopes, like in this for loop or the if conditional in the next line, are denoted using indentation instead of curly ({..}) braces. Using just whitespace indentation to define blocks may sound weird and even prone to errors! But just give it a chance and you’ll find it to quickly become second nature. Note that the Python REPL uses ellipsis (...) to indicate a block scope, you don’t type the ellipsis. The next three lines start with an ellipsis, which is the scope of this for loop.

5. On this line is an if statement that is quite similar to Java, except for the lack of parentheses. Parentheses around for and if conditional expressions are optional. Include them only when they add clarity. Apart from the for and if constructs shown here, Python also has elif, while, and so forth.

6. Here, we append the current loop number to the odd_numbers list. The list, like almost everything in Python, is an object that supports several operations on it, including the append operation.

7. Finally, we print the results to console. No more typing of the decidedly more verbose System.out. println!

ChaPter

ChaPter 2 the Syntax

Caution Never mix tabs and whitespaces in Python source code. While you can use either tabs or whitespace to denote indentation, mixing the two in the same source file may lead to parsing errors. My recommendation: just don’t use tabs and stick to spaces. Set your text editor to insert four space characters per tab.

Basic Types

Some of the basic data types in Python are numbers, strings, and collections.

Numbers

Numbers come in the following variety.

12j

Although int and long are different data types, in practice, you only need to worry about them when declaring literal values; that is, literal longs need to be declared with a L suffix. During arithmetic operations, Python automatically converts int values to long values as needed. This also prevents overflow-related bugs.

Note In Python 3, there’s no distinction between int and long; there’s only one arbitrary length integer type.

Strings

As in Java, strings are immutable in Python. String values can be wrapped in either single or double quotes. To differentiate between vanilla ASCII strings and Unicode strings, Python uses the u prefix to denote the latter. Unicode strings provide additional operations related to encoding/ decoding from various character sets.

Type Example value

A third type of string is the raw string denoted by the r prefix. This is just an indication to the Python parser to not apply any backslash escaping rules to the string. Here’s a quick example that illustrates the difference.

>>> print 'c:\temp\dir' ①

c: emp\dir

>>> print 'c:\\temp\dir' ②

c:\temp\dir

>>> print r'c:\temp\dir' ③

c:\temp\dir

>>>

1. The \t is interpreted as the tab character, resulting in a tab being printed.

2. Escaping the \t with an additional backslash helps, but makes the string harder to read.

3. Now the \t is left as-is since the r prefix is used to mark the string as a raw string.

ChaPter 2 the Syntax

2 the Syntax

As you can imagine, raw strings are extremely useful when denoting file system paths or regular expressions.

Note In Python 3, all strings are unicode by default. Strings without encoding are treated as bytes without any text semantics.

Collections

The built-in Python collections come in four varieties.

Collection Type Java Equivalent

list

tuple

dict

set

Example Value

java.util.ArrayList ['apple', 'ball', 'ball']

java.util.ArrayList ('apple', 'ball', 'ball')

java.util.HashMap {'fruit': 'apple', 'toy': 'ball'}

java.util.HashSet {'apple', 'ball'}

Each of these collection types provides several useful operations, such as sort, subsequence, and so forth. Another key property is that all these data types are heterogeneous and can host values of differing data types. Think Collection<Object> and not Collection<T>.

Tip While tuple and list may look similar, the distinction is that a tuple is immutable.

Having these basic collections built into the language syntax is immensely useful. It makes a lot of day-to-day code quite succinct without the overhead of importing collection APIs and their associated baggage.

ChaPter

Fun with Lists

Lists are the workhorse data structure in Python and I exaggerate only slightly when I say that mastering them is the key to mastering Python! Although earlier I said that they are like java.util.ArrayList, they are truly much more than that. But first, let’s look at a short example demonstrating their use as a basic array.

>>> numbers = [0, 1, 2, 'three', 4, 5, 6, 7, 8, 9] ①

>>> numbers[0] ② 0

>>> numbers[-1] ③ 9

1. The first thing to note is that the numbers list is not homogeneous and can host values of different types, be it numbers, strings, other objects or even other lists!

2. The individual element access is using the wellknown array index syntax: L[index].

3. Python allows passing in a negative value for the index, in which case, it adds the length of the list to the index and returns the corresponding element.

Apart from single element access, what sets apart Python lists is the ability to extract element ranges from lists. This is accomplished using the slice syntax. Here’s how.

>>> numbers[0:4] ① [0, 1, 2, 'three']

>>> numbers[:4] ② [0, 1, 2, 'three']

ChaPter 2 the Syntax

ChaPter 2 the Syntax

>>> numbers[4:] ③

[4, 5, 6, 7, 8, 9]

>>> numbers[2:-2] ④

[2, 'three', 4, 5, 6, 7]

>>> numbers[0:9:2] ⑤

[0, 2, 4, 6, 8]

>>> numbers[::2] ⑥

[0, 2, 4, 6, 8]

>>> numbers[::-1] ⑦

[9, 8, 7, 6, 5, 4, 'three', 2, 1, 0]

1. The slice syntax—L[start:stop]—returns a subsequence of the list as a new list.

2. The start index is optional and when omitted, defaults to 0.

3. The stop index is also optional and defaults to the length of the list.

4. A negative stop index counts off from the end, in accordance with the rule described for line 3 of this code example.

5. The full slice syntax is actually L[start:stop:step] where the step, when omitted, defaults to 1. Here, we set it to 2 and it skips every other element of the list.

6. Another example showing default values for start and stop.

7. A negative step reverses the direction of iteration.

Another random document with no related content on Scribd:

Her exceeding anxiety was placed to the score of her attachment to Sainte-Croix; and as she quitted the apartment the others went on with their duties in silence. Lachaussée seated himself in a recess of the chamber and watched their proceedings; and Philippe collected a few things together which belonged to his father, and consisted principally of some chemical glasses and evaporating dishes, placing them in a box by themselves to be moved away as soon as it was permitted.

But scarcely five minutes had elapsed ere another carriage drove into the court, and Desgrais, the active exempt of the Maréchaussée, came upstairs to the apartment, followed by one or two agents of the police. As he entered the room, he cast his eye over the different pieces of furniture, and perceiving that the judicial seal was already upon many of them, nodded his head in token of approval. Then turning to Philippe he said—

‘Monsieur Glazer, there will be no occasion to inconvenience you by detaining your own goods. Whatever you will describe as yours, shall be at once made over to you on your signature.’

‘You are very good,’ replied Philippe; ‘but everything belonging to us, in the care of this poor gentleman, was of little consequence. There is, however, that little cabinet, which may be returned to its owner, who is most anxious to have it. It has been earnestly claimed by the Marchioness of Brinvilliers.’

‘The Marchioness of Brinvilliers!’ exclaimed Desgrais with some emphasis. ‘And you say she was anxious to carry it away?’

‘Just as I have told you; in fact her solicitude was remarkable.’

Desgrais was silent for a minute.

‘Stop!’ at length he said; ‘we will examine this cabinet that appears so precious. I have reasons for it.’

By his directions Pierre Frater took down the inlaid box from its shelf, Maître Picard being too short, and placed it on the table. The others collected eagerly round, especially Lachaussée, who at the first mention of it had left his seat. Sainte-Croix’s keys were discovered in one of the drawers of the table, and Desgrais, selecting one of curiously-wrought steel, applied it to the lock. The lid instantly flew open.

‘Here is a false top,’ said Desgrais, ‘with a written paper lying open upon it. Let us see what it says.’

And taking the document, he read as follows:—

‘“I humbly ask of those into whose hands this cabinet may fall, whoever they may be, to deliver it to the Marchioness of Brinvilliers, at present living in the Rue Neuve St. Paul; since its contents are of importance to her alone, and her welfare apart, cannot be of the slightest interest to any one in the world. Should she have died before me, let the cabinet be burnt, exactly as it is, without opening it or disturbing its contents.”

‘The paper concludes,’ continued Desgrais, ‘with an appeal to God respecting the sincerity of this request, and a half-implied malediction upon those who may refuse to grant it.’

‘I presume, monsieur, now that your curiosity is satisfied thus far, I may take the box with me to Madame de Brinvilliers,’ said Lachaussée.

‘Stop!’ replied the exempt, as the other stretched forth his hand, ‘here is another paper. It is a receipt for a sum of money delivered on account of work performed, and signed “Lachaussée.”’

As his name was pronounced, Lachaussée fell back from the table, and, muttering a few indistinct words, approached the door; but Desgrais cried out—

‘You appear interested in this affair, monsieur, and cannot yet leave us. Guards, place yourselves at the doorway, and let no one pass but with my orders.’

Two of the patrol who had entered with the exempt took up their station at the door, crossing their halberds before it. A dead silence reigned, and the curiosity of all was raised to the most painful intensity. Lachaussée leant back against the bureau, and folding his arms gazed steadily at the proceedings, but no visible token betrayed his emotion.

‘This affair requires some little extra investigation,’ said Desgrais. ‘This false lid must open with a spring, as there is neither lock nor handle to it.’ He held the cabinet up, and turning it round, discovered

one of the studs that ornamented it of a darker colour than the rest, as if from constant handling. His experienced eye told him that this should be the one; he pressed it accordingly, and the partition turned up with a jerk against the side. A single and hurried expiration escaped his lips. He inverted the cabinet, and turned its contents on the table; they consisted of a number of little packets, boxes, and phials, mostly sealed up, and distinguished by various inscriptions.

‘“Sublimate!” “Vitrol!” “Opium!”’ exclaimed Desgrais, as he read each aloud. ‘Mort bleu! messieurs, we are about to make some strange discoveries!’

‘Will you allow me to pass,’ said Philippe Glazer to Desgrais, ‘I think there is no one below, and I fancied I heard the bell sound?’

‘Of course,’ replied the exempt; ‘but return as soon as you conveniently may. We shall, perhaps, hereafter need you as a witness to these revelations.’

Philippe hastily promised compliance, and then quitting the apartment, hastily flew downstairs to his father’s shop. The old man had retired to rest early, but his man Panurge was fast asleep upon one of the tables—so soundly that it required no very gentle treatment from Philippe to waken him.

‘Ho! Panurge!’ cried his young master, in a sharp but low voice, ‘awake, man, unless you wish every wretched bone in your miserable carcase broken. Do you hear me?’

‘Hippocrates sayeth that erysipelas upon the baring of a bone is evil,’ muttered Panurge, who mixed up his sleeping studies with his waking faculties.

‘Pshaw!’ cried Philippe, ‘I will give you cause for it, all over you, if you do not attend. Rouse up, I tell you.’

And he gave Panurge such a mighty shake as would have aroused him had he been in a trance. As it was, it immediately restored the assistant to the full exhibition of what faculties he possessed, and he awaited Glazer’s further orders.

‘You know the house of Monsieur Artus, the Commissary of Police, in the Rue des Noyers?’

‘I do,’ replied Panurge; ‘he hath been ill of a choleric gout, for which we gave him the juice of danewort——’

‘The pest on what you gave him!’ said Philippe, ‘so long as you know where he is to be found. Now look you; go off there directly, and if you lose no time on the way you will probably find the Marchioness of Brinvilliers at his house. Give this note to her, and only to her, as you value your useless life.’

He hastily wrote on a scrap of paper:—

‘The police have found some articles in a cabinet belonging to M. de Sainte-Croix, which may cause you much embarrassment from the publicity it will give to your acquaintance. Be careful how you proceed.

‘Now, off!’ said Philippe, hastily folding the note; ‘and return here as soon as you leave this in her own hands. Poor lady!’ he continued, half speaking to himself; ‘it would be sorrow indeed if mere gallantry should link her with the deeds of which her cavalier appears to have been the perpetrator.’

Without another syllable Panurge set off, and Glazer was returning to the room when he met Desgrais descending the stairs, carrying the cabinet and followed by two of the police, who had Lachaussée in custody between them. He addressed him—

‘We shall require the services of your father and yourself tomorrow, M. Glazer, to analyse these different articles. I have put a seal upon them, and must hold you answerable for their safe keeping.’

‘I denounce my being kept a prisoner,’ exclaimed Lachaussée, ‘as informal and unjust. You have no right to detain me upon the mere circumstance of my name appearing on that piece of paper.’

‘I will make ample reparation for any wrong I may do you,’ answered Desgrais, coolly. Then, turning to the guards, he added—

‘You will conduct this person to the Châtelet. And now, M. Frater, you can accompany me, with Maître Picard, to the Rue des Noyers without loss of time. We shall probably there light upon the Marchioness of Brinvilliers.’

Philippe’s heart was in his throat as he heard the name pronounced. He immediately endeavoured to contrive some delay in

Desgrais’s departure, offering him refreshment, begging him to stop whilst the cressets of the watch were retrimmed, and pressing articles of outer wear upon him, by reason of the cold, which he pretended he could not find. A few minutes were gained in this manner, and then the guard departed across the Place Maubert, Philippe’s only hope being that Panurge had already got there.

Whilst this scene of fearful interest was being enacted at Glazer’s, Marie had reached the house of the Commissary of Police. Some of the domestics were sitting up for further orders from Desgrais, and by them she was informed that M. Artus could not be disturbed. By dint, however, of heavy bribes, giving them all the money she had about her, which was no inconsiderable sum, she was ushered into the apartment of the Commissary, and to him, in a few hurried words, she made known the object of her visit. But her earnestness was so strange that M. Artus requested she would wait until the next day, when he should have received the report of the proceedings from his agents. Had she shown less anxiety, he would doubtless have granted what she so urgently desired.

Finding there was no chance of assistance from this quarter, she left the room in an agony of terror, and, scarcely knowing what course to pursue, was about to return to the Place Maubert, when Panurge arrived with Glazer’s note. She hastily read it, and the contents struck her like a thunderbolt. ‘Then all is over!’ she exclaimed; and without exchanging another word with the assistant, or any of the officials, she flew through the streets, half clad as she was, with the snow deep on the ground, and the thoroughfares wrapped in the obscurity of a winter night, in the direction of her hôtel in the Rue St. Paul.

CHAPTER XXVIII.

THE FLIGHT OF MARIE TO LIÉGE PARIS THE GIBBET OF MONTFAUCON

M was sounded upon the heavy bell of the Bastille by the sentinel on guard but a few minutes before the Marchioness of Brinvilliers—terrified, breathless, and, in spite of her hurry, shivering in her light dress beneath the intense cold—arrived at the Hôtel d’Aubray. There were no signs of life in that quarter of Paris, for the inhabitants had long retired to rest; a faint light, gleaming from the front windows of Marie’s residence upon the snow that covered the thoroughfare, alone served to guide her to the door. The drowsy concierge admitted her, and she hurried across the inner court and upstairs to her own apartment.

Françoise Roussel, her servant, was waiting up for her. Her mistress had left in such an extreme of anxiety, and half-undressed, that Françoise saw at once an affair of great moment had disturbed her; and now, as Marie returned, the girl was frightened by her almost ghastly look. As she entered the room she fell panting on one of the causeuses, and then her servant perceived that she had lost one of her shoes, and had been walking, perhaps nearly the whole distance from the Place Maubert, with her small naked foot upon the snow, without discovering it. In her hurried toilet, she had merely arisen from her bed and drawn her shoes on, without anything else, and throwing a heavy loose robe about her had thus hurried with Lachaussée to Glazer’s house; for from Gaudin’s accomplice she had learned the first tidings of his death and the dangerous position in which she stood. And now, scarcely knowing in the terror and agony of the moment what course to adopt, she remained for some minutes pressing her hands to her forehead, as if to seize and render available some of the confused and distracting thoughts which were hurrying through her almost bewildered brain. A few offers of assistance on the part of her domestic were met with short and angry refusals; and Françoise, almost as frightened as the

Marchioness herself, remained gazing at her, not knowing what measures she ought next to adopt.

Meanwhile, Desgrais, with the important casket, and accompanied by the clerk Frater and Maître Picard, had reached the house of M. Artus, the Commissary of Police, in the Rue des Noyers, arriving there not two minutes after Marie had quitted it to regain her own abode. Philippe Glazer had accompanied them, partly from being in a measure an implicated party in the affair, but chiefly out of anxiety for the position of the Marchioness, in whose guilt he had not the slightest belief He was aware of her connection with Sainte-Croix; but this was a matter of simple gallantry, and in the time of Louis Quatorze much more likely to enlist the sympathies of the many on the side of the erring party than to excite their indignation.

‘I suppose you have no further occasion for me?’ observed Maître Picard, as he stood at the foot of M. Artus’s bed, after having awaited the conclusion of Desgrais’s account of the discovery; ‘because, if you have not, I would fain go home.’

The little bourgeois was thinking of the roast pheasant which he had abandoned to the voracity of the Gascon. He had a wild hope that it might be yet untouched.

‘Stop, mon brave,’ said Desgrais. ‘You cannot leave me until we have found Madame de Brinvilliers. I have only missed her by a few seconds. You must come on with me to her house, where she most likely is by this time.’

‘I suppose there is no necessity for me to remain here longer,’ said Philippe Glazer.

‘None whatever, monsieur,’ replied the exempt. ‘You will take care of M. de Sainte-Croix’s property; and we may call upon you tomorrow to analyse the contents of this casket.’

Philippe bowed, and left the room. The moment he was clear of the house, having borrowed a lighted lantern from one of the guard, who was at the door, he set off as fast as his legs would carry him towards the Rue St. Paul, having heard enough to convince him that the Marchioness was in danger of being arrested. Upon reaching the Hôtel d’Aubray he clamoured loudly for admission. At the sound of the first knock he perceived a form, which he directly recognised to be that of Marie, peep from behind the edge of the curtain and

immediately disappear Some little delay took place before his summons was answered, and then the concierge, peering through the half-opening of the door, told him that Madame de Brinvilliers was not within. Pushing the menial on one side, with a hurried expression of disbelief, Philippe forced his way into the court, and perceived, as he entered, the figure of the Marchioness hurrying upstairs. He bounded after her, and stood by her side upon the landing.

‘Philippe!’ exclaimed Marie, as she recognised his features. ‘I was afraid it was Desgrais, and I had gone down to give orders that no one might be admitted.’

‘You have not an instant to lose,’ replied young Glazer hurriedly, ‘and must leave the house in reality. I have just now left them with M. Artus, about to come on and arrest you. You must fly—instantly.’

‘Fly! by what means?’ asked Marie; ‘my horses are at Offemont, except the one at—at his house in the Rue des Bernardins. O Philippe!’ she continued, ‘tell me what to do in this fearful extremity. I know not how to act—I am nearly dead.’

All her self-possession, all her duplicity, gave way beneath the crushing agony of the moment. She burst into tears, and would have fallen to the ground had not Philippe caught her in his arms.

‘Is there nothing in the stables that we can depart with?’ asked he of Françoise, who had been watching this short scene with trembling attention. ‘It will not do to hire a carriage, as that would give a certain clue to our route.’

‘A man brought a tumbrel here this afternoon, with some things from the country. He has left it, with the horse, in the stables, and sleeps himself at the Croix d’Or, in the Rue St. Antoine.’

‘Bring this light with you, and show me the way,’ said Philippe, as he placed the Marchioness in a fauteuil, and hurried downstairs, followed by the femme de chambre.

As soon as the girl had indicated the spot, Glazer told her to return to her mistress and bid her prepare as quickly as she could to leave Paris, taking with her only such few things as were immediately necessary. Next, pulling the drowsy horse from his stall, he proceeded to harness him, as well as his acquaintance with such matters allowed him to do, to the rude country vehicle which

Françoise had spoken about. All this was not the work of five minutes; and he then returned to Marie’s apartment.

But, brief as the interval had been, Marie had in the time recovered her wonted firmness, and aided by her servant had rapidly made her toilet, wrapping herself in her warmest garments for protection against the inclemency of the weather. When Philippe entered, he found Françoise occupied in making up a small parcel, half unconscious, however, of what she was doing, from flurry at the evident emergency of the circumstances; and Marie was standing before the fire, watching the destruction of a large packet of letters and other papers, which were blazing on the hearth.

‘I am ready, madame,’ said Philippe; ‘do not delay your departure an instant longer, or you cannot tell into what perplexities you may fall. Every moment is of untold value.’

‘Where do you propose to take me?’ asked the Marchioness earnestly.

‘I see no better refuge for the instant than your château at Offemont.’

‘Offemont!’ exclaimed Marie; ‘it is twenty leagues from Paris; and in this dreadful weather we should perish on the route.’

‘It must be attempted,’ said Philippe; ‘you say your horses are there; and if we can once reach them, your means of getting to the frontier will be comparatively easy. We must brave everything. Your enemies I know to be numerous in Paris, and you cannot tell what charges they might bring against you when in their power, which it would be next to impossible to refute. Come, come!’

He took her by the hand and led her to the door, the servant following them closely, and receiving from the Marchioness a number of hurried directions and commissions, which it was next to impossible she could remember. As he quitted the room, with some forethought Philippe blew out the candles and collected the pieces; for the night would be long and dark; there were seven or eight hours of obscurity yet before them. When they got to the court where the horse and tumbrel were, the former evidently in no hurry to depart, young Glazer fastened the lantern he had borrowed from the guard to the side of the vehicle, and then assisted the Marchioness to mount and take her seat upon some straw.

‘It is a rude carriage, madame,’ he said; ‘but the journey would be less pleasant if it was going to the Place de Grêve.’

Marie shuddered as he spoke; but it was unobserved in the obscurity. As soon as she was seated, Philippe drew a coarse awning over some bent sticks which spanned the interior, and making this tight all round, prepared to start.

‘Stop!’ he exclaimed, as if struck by a sudden thought; ‘it will be as well to see all clear before us.’

And he advanced to the porte-cochère that opened into the street, when to his dismay he perceived the lighted cressets of the Guet Royal coming down the Rue Neuve St. Paul. In an instant he closed the door and barred it; and turning to Françoise, exclaimed—

‘Go up to the window of your mistress’s room, which looks into the road, and when the guard comes, say she is from home.’

‘There is a court which leads from the stables to the Rue St. Antoine,’ said the Marchioness from the vehicle. ‘You can get out that way.’

‘It is lucky,’ said Philippe, ‘or we should otherwise have been trapped. Françoise! up—up, and detain them every instant that you can. I will prevent the concierge from replying.’

He took his handkerchief and hurriedly tied it round the clapper of the bell, which hung within his reach over the porter’s lodge. Then, turning round the cart, he led the horse through the inner court and stabling to the passage indicated by the Marchioness. Fortunately the snow was on the ground, and there was little noise made beyond the creaking of the vehicle, which in half a minute emerged into the Rue St. Antoine, and Philippe closed the gate behind him.

The thoroughfare was dark and silent; but the snow was falling heavily, as its twinkling by the side of the lantern proved. This was so far lucky, because it would cover the traces of their route almost as soon as they were made. The fugitives could plainly hear the sound of voices and the clatter of arms in the Rue Neuve St. Paul; and aware that the delay could only last for a few minutes, Philippe urged on the animal as well as he could, and turned up a small street which ran in a northerly direction from the Rue St. Antoine.

‘You are passing the gate,’ said Marie, who all along had been looking anxiously from the vehicle, as she pointed towards the

Bastille, where one or two lights could be seen, apparently suspended in the air, from the windows of the officials and the guardroom.

‘I know it, madame,’ replied Philippe. ‘It would not be safe for us to leave the city by that barrier. It is the nearest to your house; and if they suspect or discover that you have left Paris, they will directly conclude it is by the Porte St. Antoine there, and follow you. Besides, we might be challenged by the sentinels.’

‘You are right,’ said the Marchioness; ‘the Porte du Temple will be better.’

And shrouding herself in her cloak, she withdrew under the rough shelter of the tilt; whilst Philippe kept on, still leading the horse, through a labyrinth of small narrow streets, which would have been cut by a line drawn from the Bastille to the Temple. At last he emerged upon the new road formed by the destruction of the fortifications, which we now know as the boulevards, and reached the gate in question, which he passed through unquestioned by the gardien, who merely regarded the little party as belonging to one of the markets. Had he been entering the city instead, he would have been challenged; but, as the authorities did not care what any one took out of it, he was allowed to go on his way amidst a few houses immediately beyond the barrier, forming the commencement of the faubourg, until he came into the more open country. Here the reflected light from the white ground in some measure diminished the obscurity. The snow, too, had drifted into the hollows, leaving the road pretty clear; and Philippe clambered on to the front of the tumbrel, taking the reins in his hand, and drove on as he best might towards the grande route. Not a word was exchanged between these two solitary travellers. Marie kept in a corner of the vehicle, closely enveloped in her mantle; and her companion had enough to do to watch the line they were taking, and keep his hearing on the stretch to discover the first sounds of pursuit.

‘Peste!’ exclaimed Philippe at length, as one of the wheels jolted into a deep rut, and the lantern was jerked off and its light extinguished; ‘this is unlucky. We did not see too well with it, and I don’t know how we shall fare now.’

He jumped down as he spoke, and tried to rekindle the light with his breath; but it was of no use; he entirely extinguished the only spark remaining. In this dilemma he looked around him, to see if there was a chance of assistance. Marie also was aroused from her silence by the accident, and gazed earnestly from the cart with the same purpose. At last, almost at the same instant, they perceived a thin line of light, as though it shone through an ill-closed shutter, but a little way ahead of them; and the stars, which had been slowly coming out, now faintly showed the outline of a high and broken ground upon their right. At the top of this some masonry and broken pillars were just observable, supporting cross-beams, from which, at certain distances, depended dark, irregularly-shaped objects. It was a gloomy locality, and Philippe knew it well, as he made out the crumbling remains of the gibbet at Montfaucon.

‘I should have taken this as a bad omen,’ said he, half joking, ‘if the fourche had been still in use. It would have looked as though the beam was meant for our destination.’

As they approached the small cabin from which the light came, Philippe shouted to awaken the attention of those within; but no answer being returned, he jumped down, and knocked furiously at the door. He heard some whispers for a minute or two, and then a woman’s voice demanded, ‘Who is there?’

‘A traveller, who wants a light,’ cried Philippe, ‘to guide him safely to Bourget. For pity, madame, don’t keep me here much longer, or I must be ungallant, and kick in the door.’

There was evidently another conference within, and then the door was cautiously opened. Philippe entered, and his eyes directly fell upon Exili, whilst the female proved to be a woman who was practising fortune-telling in Paris—it was supposed as a cloak for darker matters—and was known to some of the people, and to the whole of the police, as La Voisin. The physician and the student recognised each other immediately, for they had often met on the carrefours, and each uttered a hurried exclamation of surprise at the rencontre.

‘Monsieur Glazer,’ said Exili, as Philippe took a light from the fire, ‘you have seen me here, and possibly are acquainted with what has taken place in the Quartier Latin this evening.’

‘I know everything,’ replied Glazer

‘Then I must ask you, on your faith, to keep my secret,’ said Exili. ‘You have discovered me in coming here to serve yourself; but this refuge is to me an affair of life and death. You will not betray me?’

‘You may trust me,’ said Philippe carelessly; ‘and in return, madame,’ he continued, turning to La Voisin, ‘if any others should come up, let your story be that you have seen no one this night. Mine also is a case of emergency, and a lady—high-born, rich, and beautiful—is concerned in it.’

The woman assured Philippe he might depend upon her secrecy; and he was about to depart with his lantern, when Exili stopped him.

‘Stay!’ he exclaimed earnestly. ‘Who is it you have with you?’ And as he spoke the strange fire kindled in his falcon eyes that always bespoke the working of some terrible passion within.

‘It cannot concern you,’ replied Philippe. ‘I have got my light, and our interview is concluded.’

‘Not yet,’ answered Exili quickly. ‘A woman—rich, high-born, and beautiful. It is the Marchioness of Brinvilliers!’

And before Philippe could stop him, he rushed forward and threw open the covering of the cart, discovering Marie still crouching in the corner of the vehicle.

‘I have you, then, at last,’ he cried, in a voice choking with rage, as he recognised her. ‘Descend!—fiend! demon! murderess of my son! Descend! for you are mine—mine!’

He was about to climb up the vehicle, when Marie, to whom part of the speech was entirely incomprehensible, shrank to the other side of the tumbrel, and called upon Philippe to defend her. But this was not needed. The young student had clutched the physician by the neck, and pulled him back on to the ground.

‘What do you mean by this outrage, monsieur?’ he asked.

‘She is a murderess, I tell you!’ he continued hoarsely. ‘Her damned arts drove my son—him they called Sainte-Croix—to death! She killed him, body and soul, and she belongs to me. I will denounce her to the Chambre Ardente.’

‘Keep back!’ cried Philippe; ‘you are mad! What has the Marchioness of Brinvilliers in common with yourself?’

‘You shall see,’ answered Exili. ‘Look there—in the faubourg—the guard is coming. They have tracked you.’

And indeed the lights were visible from the cressets carried by the Guet Royal at the extreme end of the route. Philippe sprung upon the tumbrel as Exili spoke, and tried to proceed; but the other seized the horse’s head and endeavoured to arrest his progress.

‘Stand away!’ exclaimed young Glazer, ‘or you are a dead man!’

‘I shall not move,’ was Exili’s reply. ‘I shall be doomed myself, but I will drag her with me to the scaffold. See! they are coming—she is mine!’

His further speech was cut short by Philippe, who, raising his heavy country whip, struck the physician with all his force with the butt-end upon the temple. Exili staggered back, and then the student, lashing his horse furiously, drove from the hovel with tolerable speed, placing the lantern under the covering, that it might not be seen; whilst Marie, without speaking a word, gazed anxiously behind upon the advancing patrol. In a minute, however, a turn of the road shut them from her sight, and the travellers found themselves approaching the faubourg of La Villette, upon the high-road, without the Porte St. Martin.

It was, as Exili had said, a party of the guard who were in pursuit, mounted, and headed by Desgrais. The active exempt had gone to the Hôtel d’Aubray, as we have seen, and being at last admitted by Françoise, had seen some traces of a departure on the snow, which had drifted into the sheltered parts of the court. But in the street the fall had covered up the wheel-tracks; and, as the fugitives had conceived, he went directly to the Porte St. Antoine. The sentinel, however, told him that no one had passed the barrier; and he then rode briskly along the boulevards to the next gate, near the Temple. Here he learned a tumbrel had gone out of the city but a few minutes before his arrival; upon which he divided his troop into two parties, sending one along the road to La Courtille, whilst with the other he took the same line that Philippe had chosen, these being the only two practicable routes for vehicles without the barrier, and accompanied by the latter escort he soon arrived at the foot of Montfaucon.

Exili had been stunned for a few seconds by the heavy blow which Philippe Glazer had dealt to him; but, recovering himself before the guard came up, he darted back into the hovel, and seizing a piece of lighted wood from the hearth, told La Voisin to save herself as she best might, and then scrambled with singular agility up the steep mound at the back of the house, until he reached the stone-work of the gibbet. This was crumbling, and afforded many foot-places by which he could ascend, until he stood between two of the pillars that still supported the crosspieces, above the hollow way along which Desgrais and his troop were progressing.

The exempt knew the physician directly, as his gaunt form appeared in the lurid light of the cressets, and the rude torch that he himself carried; and he would have ordered the guard immediately to capture him, had not Exili arrested the command by speaking.

‘You seek the Marchioness of Brinvilliers,’ he cried. ‘She was here not an instant back; and you will find her, if you care to hurry, on the grande route.’

‘I call upon you to surrender yourself my prisoner,’ said Desgrais, speaking from below; ‘you may then guide us on the track.’

‘If I had meant to give myself up,’ said Exili, ‘I should have remained below. I have put you on the scent, and that was all I wanted. Farewell!’

He waved his hand to the officers, and disappeared behind the foundation of the masonry. On seeing this, Desgrais sprang

The

Arrest of Exili

from his horse, and, seizing a cresset from the guard, told one or two of the others to follow him, as he rapidly ascended the mound. He was active, his limbs were well-knit, and a few seconds sufficed to bring him to the spot from whence Exili had spoken; but as he looked over the area of masonry, not a trace of the physician was visible, except the smouldering brand which he had flung down upon the ground.

The others had arrived at the platform, and by the additional light from their cressets Desgrais perceived an opening in the stone-work, conducting below by ragged jutting angles of masonry, and down this he boldly proceeded to venture. It conducted to a terrible spot—the cemetery of those unfortunates who had perished on the gibbet, into which the bodies were thrown in former times, to make room for

fresh victims on the fourche But now the dry bones were all that remained, crushing and rattling beneath the feet of the exempt as he proceeded; for nearly a century had elapsed since the last execution —that of the wise and just Coligni, during the fiendish massacre of St. Bartholomew. But the place had been undisturbed, time alone having altered its features; the only intruders upon its dreary loneliness being the dogs, and the sorcerers, who came thither for materials to give a horrid interest to their calling and frighten the vulgar who came to consult them.

By the flaring light of the cressets Desgrais beheld Exili cowering at the end of the vault. His object had evidently been to betray the Marchioness, whilst he eluded capture himself; but he had underrated the keen vigilance of the exempt. He had been taken in a trap; and as one or two of the Guet Royal followed Desgrais, he saw that further resistance was useless. He held up his hand to prevent the threatened attack which the others seemed inclined to make; and then, advancing to the exempt, muttered—

‘I am your prisoner; take me where you please. The game is up at last.’

The party retraced their steps, and descended once more to the byway of the faubourgs. Bidding two of the patrol watch Exili, Desgrais next went into the hovel, and ordered the woman to come forth. She immediately obeyed, and made a haughty reverence to the authorities.

‘Madame Catherine Deshayes,’ said Desgrais, ‘by your name of La Voisin you are already under the surveillance of the police. You will please to accompany them at present, until your connection with the Signor Exili can be explained.’

Some of the patrol directly took their places on either side of the woman, and then Desgrais turned to Exili.

‘You will stay for to-night,’ he said, ‘in the Châtelet; to-morrow other arrangements will be made for your sojourn until the opening of the next chamber at the Arsenal. Two of you,’ he continued, addressing the guard, ‘will take charge of the prisoner to Paris.’

‘Then you will not want me to follow Madame de Brinvilliers?’ said Exili.

‘We do not now require your aid,’ was the reply ‘Messieurs,—en route!’

The guard prepared to mount, when one of them rode, apparently in a great feeling of insecurity, through the little knot of patrol, and approached Desgrais. The lights revealed the form and features of Maître Picard.

‘Monsieur,’ said the little bourgeois, ‘I fear my horse is tired. I will therefore form one of the escort to take the prisoner to the Châtelet.’

‘I fear we cannot spare you just yet, mon brave,’ said Desgrais. ‘You are the only member of the Garde Bourgeois with us, and we may need your authority after mine. You must come on at present.’

Maître Picard groaned as he turned his horse’s bridle back again. He was evidently ill at ease in the saddle. He could just touch the stirrups—the leathers of which were much too long for him—with the tips of his toes; and as he had not crossed a horse since his grand progress to Versailles, he complained that the action of the present steed was somewhat too vigorous for him. But he was obliged to obey the orders of the exempt, and fell into the rear accordingly.

‘A country cart, drawn by one horse, and covered with a tilt, is the object of our chase,’ said Desgrais. ‘It cannot be ten minutes before us. Forward!’

The majority of the guard set off at a smart trot along the hollow way, whilst those who remained placed their prisoners between them, and prepared to return by the Porte du Temple to Paris.

CHAPTER XXIX.

PHILIPPE AVAILS HIMSELF OF MAÎTRE PICARD’S HORSE FOR THE MARCHIONESS

P G made the best use of the time taken up in the enactment of this hurried scene. Urging the horse on, he had already left the scattered houses of La Villette behind them, and was now in the open country, hastening as fast as the snow would permit towards Le Bourget, at which village he had an acquaintance who would give him and his companion temporary shelter, and lend him a fresh horse, if requisite. The road was long and straight, and any light could be seen at a great distance. As they proceeded, still in silence, Marie kept watching from the back of the tumbrel, to give the student the first alarm of any indications of pursuit.

‘Philippe,’ at length she exclaimed in a low voice, as though she thought it would be heard in the extreme distance, ‘they are coming! I can see the lights at La Villette moving. Exili has betrayed us; what must be done?’

Her conductor jumped down to the ground as she spoke, and looked towards the hamlet, where the cressets were indeed visible. Every moment of advance was now most precious. He applied the lash with renewed activity to the flanks and legs of the horse, but with little effect. The animal was tired when he started; and the snow was now clogging round the wheels, rendering any material progress beyond his strength. At last, on coming to a deep drift, after a few attempts to drag the tumbrel through, he stopped altogether.

‘Malediction!’ muttered Philippe through his teeth; ‘everything is against us.’

‘They appear to be coming on at a fast trot,’ exclaimed Marie, as she hastily descended from the vehicle and stood at the side of the student. ‘We cannot possibly escape them.’

‘I am not foiled yet,’ replied Philippe. ‘We cannot outrun them, so we must try stratagem.’

Fortunately there was a small by-road running into a species of copse at the wayside, upon which was stored large stacks of firewood. Giving the Marchioness his whip, he directed her to flog the horse, whilst he himself with all his power turned one of the wheels. Marie complied—it was no time to hesitate; and by their united efforts they urged the animal forward, turning him off the road towards the copse, behind one of whose wood piles the vehicle was soon concealed.

‘Now,’ he said, ‘if they do not see us, we are safe.’

A few minutes of terrible anxiety supervened as the patrol came on at a rapid pace, their arms clanking and shining in the light of the cressets which one or two of them still carried, blazing brightly as the quick passage through the air fanned up their flames. Sure of the object of their pursuit, as they imagined, they did not pause to examine any of the tracks upon the ground, but were pushing hastily forward towards Le Bourget, where they either expected to come up with the fugitive, or receive information that would speedily place her in their hands. They came on, and were close to the spot where the others had turned off the road. Marie held her breath, and clasped Philippe’s arm convulsively; but neither uttered a syllable as they heard them pass, and could distinctly recognise Desgrais’s voice.

‘They have gone on!’ exclaimed the Marchioness as the sounds diminished.

‘Stop!’ said Philippe drawing her back, for she had advanced beyond their concealment to look after the patrol; ‘do not move; there are more to come.’

As he spoke a horseman came slowly up, who appeared to be lagging behind the rest as a sentinel. The starlight was sufficient to show Philippe that he was alone; and in the stillness the student could hear the rider muttering words of displeasure, and abusing the horse, as he rolled uneasily about on his saddle. He stopped exactly opposite the copse, and for a moment Philippe imagined they were discovered. But he was soon undeceived. The patrol, after vainly endeavouring to tighten his saddle-girths as he sat on the horse, attempted to dismount; but being short and round in figure, he could not well reach the ground from the stirrup, and the consequence was, he rolled down, and over and over in the snow like a ball.

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.