100% found this document useful (3 votes)
15 views

An Introduction to Python Programming for Scientists and Engineers Johnny Wei-Bing Lin instant download

An Introduction to Python Programming for Scientists and Engineers is a comprehensive guide designed to teach Python programming through practical examples relevant to various scientific disciplines. The book emphasizes hands-on learning with exercises and online resources, making it suitable for complete beginners while progressively introducing advanced concepts. Authored by experts in the field, it aims to equip students and professionals with the skills needed to effectively use Python for scientific problem-solving.

Uploaded by

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

An Introduction to Python Programming for Scientists and Engineers Johnny Wei-Bing Lin instant download

An Introduction to Python Programming for Scientists and Engineers is a comprehensive guide designed to teach Python programming through practical examples relevant to various scientific disciplines. The book emphasizes hands-on learning with exercises and online resources, making it suitable for complete beginners while progressively introducing advanced concepts. Authored by experts in the field, it aims to equip students and professionals with the skills needed to effectively use Python for scientific problem-solving.

Uploaded by

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

An Introduction to Python Programming for

Scientists and Engineers Johnny Wei-Bing Lin


download

https://ebookmeta.com/product/an-introduction-to-python-
programming-for-scientists-and-engineers-johnny-wei-bing-lin/

Download more ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

Introduction to Python for Engineers and Scientists:


Open Source Solutions for Numerical Computation 1st
Edition Sandeep Nagar

https://ebookmeta.com/product/introduction-to-python-for-
engineers-and-scientists-open-source-solutions-for-numerical-
computation-1st-edition-sandeep-nagar/

Introduction to Scilab: For Engineers and Scientists


1st Edition Sandeep Nagar

https://ebookmeta.com/product/introduction-to-scilab-for-
engineers-and-scientists-1st-edition-sandeep-nagar/

Introduction to Octave: For Engineers and Scientists


1st Edition Sandeep Nagar

https://ebookmeta.com/product/introduction-to-octave-for-
engineers-and-scientists-1st-edition-sandeep-nagar/

Serial Sabotage 1st Edition Carolyn Keene

https://ebookmeta.com/product/serial-sabotage-1st-edition-
carolyn-keene/
Yard Birds The Lives and Times of America s Urban
Chickens First Edition Philip Levy

https://ebookmeta.com/product/yard-birds-the-lives-and-times-of-
america-s-urban-chickens-first-edition-philip-levy/

Swaiman’s Pediatric Neurology. Principles and Practice


6th Edition Kenneth F. Swaiman

https://ebookmeta.com/product/swaimans-pediatric-neurology-
principles-and-practice-6th-edition-kenneth-f-swaiman/

Handbook of Pediatric Epilepsy Case Studies 2nd Edition


Maria Augusta Montenegro

https://ebookmeta.com/product/handbook-of-pediatric-epilepsy-
case-studies-2nd-edition-maria-augusta-montenegro/

Electrophysiological Recording Techniques 2nd Edition


Robert P Vertes Editor Timothy Allen Editor

https://ebookmeta.com/product/electrophysiological-recording-
techniques-2nd-edition-robert-p-vertes-editor-timothy-allen-
editor/

Prince Musical Icon 1st Edition Stephanie Watson

https://ebookmeta.com/product/prince-musical-icon-1st-edition-
stephanie-watson/
Joseph Portraits Through the Ages 1st Edition Alan T.
Levenson

https://ebookmeta.com/product/joseph-portraits-through-the-
ages-1st-edition-alan-t-levenson/
An Introduction to Python Programming for
Scientists and Engineers

Python is one of the most popular programming languages, widely used for data analysis
and modelling, and is fast becoming the leading choice for scientists and engineers. Unlike
other textbooks introducing Python, typically organised by language syntax, this book uses
many examples from across Biology, Chemistry, Physics, Earth science, and Engineering to
teach and motivate students in science and engineering. The text is organised by the tasks
and workflows students undertake day-to-day, helping them see the connections between
programming tools and their disciplines. The pace of study is carefully developed for complete
beginners, and a spiral pedagogy is used so concepts are introduced across multiple chapters,
allowing readers to engage with topics more than once. “Try This!” exercises and online
Jupyter notebooks encourage students to test their new knowledge, and further develop their
programming skills. Online solutions are available for instructors, alongside discipline-specific
homework problems across the sciences and engineering.

Johnny Wei-Bing Lin is an Associate Teaching Professor and Director of Undergraduate


Computing Education in the Division of Computing and Software Systems at the University
of Washington Bothell, and an Affiliate Professor of Physics and Engineering at North Park
University. He was the founding Chair of the American Meteorological Society’s annual
Python Symposium.

Hannah Aizenman is a Ph.D. candidate in Computer Science at The Graduate Center, City
University of New York. She studies visualization and is a core developer of the Python
library Matplotlib.

Erin Manette Cartas Espinel graduated with a Ph.D. in physics from the University of
California, Irvine. After more than 10 years at the University of Washington Bothell, she
is now a software development engineer.

Kim Gunnerson recently retired as an Associate Teaching Professor at the University of


Washington Bothell, where she taught chemistry and introductory computer programming.

Joanne Liu received her Ph.D. in Bioinformatics and Systems Biology from the University of
California San Diego.
“This book provides an excellent introduction to the Python language especially targeted at those
interested in carrying out calculations in the physical sciences. I especially like the strong coverage of
graphics and of good coding practice.”
Raymond Pierrehumbert, University of Oxford

“An excellent introduction to Python for scientists and engineers. Much more than teaching you how to
program with Python, it teaches you how to do science with Python.”
Eric Shaffer, University of Illinois at Urbana-Champaign

“Python has achieved an essential role in many disciplines within science, engineering, and beyond.
Students and professionals are expected to be fluent in it, and (as I see in my daily job of helping users of a
high-performance computing facility) they often struggle to reach that fluency. The authors have succeeded
in the daunting task of writing a single book to help people reach a very advanced level of fluency, starting
very gently and assuming no background. Unlike other books on the subject, An Introduction to Python
Programming for Scientists and Engineers focuses on teaching for the intended end goal of scientists and
engineers – investigating their scientific problems – not writing software for its own sake. I am looking
forward to working with the generation who will learn how to program in Python using this book!”
Davide Del Vento, NCAR Computational & Information Services Laboratory

“An Introduction to Python Programming for Scientists and Engineers introduces programming in Python
using evidence-based approaches to active learning. The exercises help both students and instructors
identify misconceptions in programming, allowing students to build a strong foundation in Python
programming. The book streamlines content such that there is a focus on mastering immediately useful
concepts, normalizing errors, and demonstrating recovery.”
Kari L. Jordan, Executive Director, The Carpentries
An Introduction to Python
Programming for Scientists
and Engineers

Johnny Wei-Bing Lin


University of Washington Bothell and North Park University

Hannah Aizenman
City College of New York

Erin Manette Cartas Espinel


Envestnet Tamarac

Kim Gunnerson
University of Washington Bothell

Joanne Liu
Novozymes A/S
University Printing House, Cambridge CB2 8BS, United Kingdom

One Liberty Plaza, 20th Floor, New York, NY 10006, USA

477 Williamstown Road, Port Melbourne, VIC 3207, Australia

314-321, 3rd Floor, Plot 3, Splendor Forum, Jasola District Centre,


New Delhi – 110025, India

103 Penang Road, #05–06/07, Visioncrest Commercial, Singapore 238467

Cambridge University Press is part of the University of Cambridge.

It furthers the University’s mission by disseminating knowledge in the pursuit of


education, learning, and research at the highest international levels of excellence.

www.cambridge.org
Information on this title: www.cambridge.org/highereducation/isbn/9781108701129
DOI: 10.1017/9781108571531

© Johnny Wei-Bing Lin, Hannah Aizenman, Erin Manette Cartas Espinel,


Kim Gunnerson, and Joanne Liu 2022

This publication is in copyright. Subject to statutory exception


and to the provisions of relevant collective licensing agreements,
no reproduction of any part may take place without the written
permission of Cambridge University Press.
First published 2022

Printed in the United Kingdom by TJ Books Limited, Padstow Cornwall

A catalogue record for this publication is available from the British Library.

Library of Congress Cataloging-in-Publication Data


Names: Lin, Johnny Wei-Bing, 1972– author. | Aizenman, Hannah, 1987– author. |
Espinel, Erin Manette Cartas, 1965– author. | Gunnerson, Kim Noreen, 1965– author. |
Liu, Joanne (Joanne K.), author.
Title: An introduction to Python programming for scientists and engineers /
Johnny Wei-Bing Lin, University of Washington, Bothell, Hannah Aizenman,
City College of New York, Erin Manette Cartas Espinel, Envestnet Tamarac,
Kim Gunnerson, University of Washington, Bothell, Joanne Liu, Biota Technology Inc.
Description: First edition. | Cambridge, United Kingdom ; New York, NY :
Cambridge University Press, 2022. | Includes bibliographical references and index.
Identifiers: LCCN 2022000136 | ISBN 9781108701129 (paperback)
Subjects: LCSH: Python (Computer program language) | Computer programming. |
Engneering–Data processing. | BISAC: SCIENCE / Earth Sciences / General
Classification: LCC QA76.73.P98 L55 2022 | DDC 005.13/3–dc23/eng/20220304
LC record available at https://lccn.loc.gov/2022000136

ISBN 978-1-108-70112-9 Paperback

Cambridge University Press has no responsibility for the persistence or accuracy


of URLs for external or third-party internet websites referred to in this publication
and does not guarantee that any content on such websites is, or will remain,
accurate or appropriate.
Contents

Detailed Contents page vii


Preface xvii
To the Student xxiii
Notices and Disclaimers xxvi
Acknowledgments xxix

Part I Getting Basic Tasks Done 1


1 Prologue: Preparing to Program 3

2 Python as a Basic Calculator 8

3 Python as a Scientific Calculator 27

4 Basic Line and Scatter Plots 52

5 Customized Line and Scatter Plots 88

6 Basic Diagnostic Data Analysis 124

7 Two-Dimensional Diagnostic Data Analysis 176

8 Basic Prognostic Modeling 209

9 Reading In and Writing Out Text Data 261

10 Managing Files, Directories, and Programs 327

Part II Doing More Complex Tasks 353

11 Segue: How to Write Programs 355

12 n-Dimensional Diagnostic Data Analysis 365

13 Basic Image Processing 394

v
vi Contents

14 Contour Plots and Animation 439

15 Handling Missing Data 483

Part III Advanced Programming Concepts 503


16 More Data and Execution Structures 505

17 Classes and Inheritance 536

18 More Ways of Storing Information in Files 570

19 Basic Searching and Sorting 595

20 Recursion 633

Part IV Going from a Program Working to Working Well 655


21 Make It Usable to Others: Documentation and Sphinx 657

22 Make It Fast: Performance 666

23 Make It Correct: Linting and Unit Testing 683

24 Make It Manageable: Version Control and Build Management 693

25 Make It Talk to Other Languages 702

Appendix A List of Units 706

Appendix B Summary of Data Structures 708

Appendix C Contents by Programming Topic 709

Glossary 719
Acronyms and Abbreviations 726
Bibliography 727
Index 729
Detailed Contents

Preface page xvii


To the Student xxiii
Notices and Disclaimers xxvi
Acknowledgments xxix

Part I Getting Basic Tasks Done 1


1 Prologue: Preparing to Program 3
1.1 What Is a Program and Why Learn to Program? 3
1.2 What Is Python and Why Learn This Language? 5
1.3 Software We Will Need 6

2 Python as a Basic Calculator 8


2.1 Example of Python as a Basic Calculator 8
2.2 Python Programming Essentials 10
2.2.1 Expressions and Operators 10
2.2.2 Variables 13
2.2.3 The Python Interpreter 15
2.3 Try This! 18
2.4 More Discipline-Specific Practice 24
2.5 Chapter Review 24
2.5.1 Self-Test Questions 24
2.5.2 Chapter Summary 25
2.5.3 Self-Test Answers 26

3 Python as a Scientific Calculator 27


3.1 Example of Python as a Scientific Calculator 27
3.2 Python Programming Essentials 28
3.2.1 Using Prewritten Functions 29
3.2.2 Importing Modules and Using Module Items 30
3.2.3 Writing and Using Our Own Functions 32
3.2.4 A Programmable Calculator 35
3.2.5 Python Interpreter and Code-Writing Environments for
More Complex Programs 38
3.3 Try This! 41

vii
viii Detailed Contents

3.4 More Discipline-Specific Practice 47


3.5 Chapter Review 47
3.5.1 Self-Test Questions 47
3.5.2 Chapter Summary 48
3.5.3 Self-Test Answers 49

4 Basic Line and Scatter Plots 52


4.1 Example of Making Basic Line and Scatter Plots 52
4.2 Python Programming Essentials 54
4.2.1 Positional Input Parameters for Required Input 55
4.2.2 Introduction to Lists and Tuples 58
4.2.3 Introduction to Strings 62
4.2.4 Introduction to Commenting and Jupyter Markdown 66
4.3 Try This! 69
4.4 More Discipline-Specific Practice 81
4.5 Chapter Review 81
4.5.1 Self-Test Questions 81
4.5.2 Chapter Summary 83
4.5.3 Self-Test Answers 85

5 Customized Line and Scatter Plots 88


5.1 Example of Customizing Line Plots 88
5.2 Python Programming Essentials 91
5.2.1 Optional Input into Functions Using Keyword Input Parameters 91
5.2.2 Customizing How the Plot Looks 93
5.2.3 Handling Multiple Figures or Curves 96
5.2.4 Adjusting the Plot Size 97
5.2.5 Saving Figures to a File 98
5.2.6 Introduction to Array Calculations 99
5.2.7 The Concept of Typing 103
5.3 Try This! 106
5.4 More Discipline-Specific Practice 117
5.5 Chapter Review 117
5.5.1 Self-Test Questions 117
5.5.2 Chapter Summary 119
5.5.3 Self-Test Answers 121

6 Basic Diagnostic Data Analysis 124


6.1 Example of Basic Diagnostic Data Analysis 124
6.2 Python Programming Essentials 126
6.2.1 More on Creating Arrays and Inquiring about Arrays 128
6.2.2 More on Functions on Arrays 132
Detailed Contents ix

6.2.3 Going Through Array Elements and an Introduction to Loops 134


6.2.4 Introduction to Asking Questions of Data and Branching 139
6.2.5 Examples of One-Dimensional Loops and Branching 148
6.2.6 Docstrings 153
6.2.7 Three Tips on Writing Code 155
6.3 Try This! 158
6.4 More Discipline-Specific Practice 170
6.5 Chapter Review 170
6.5.1 Self-Test Questions 170
6.5.2 Chapter Summary 171
6.5.3 Self-Test Answers 173

7 Two-Dimensional Diagnostic Data Analysis 176


7.1 Example of Two-Dimensional Diagnostic Data Analysis 176
7.2 Python Programming Essentials 182
7.2.1 The Shape of Two-Dimensional Arrays 183
7.2.2 Creating Two-Dimensional Arrays 184
7.2.3 Accessing, Setting, and Slicing in a Two-Dimensional Array 186
7.2.4 Array Syntax and Functions in Two-Dimensional Arrays 190
7.2.5 Nested for Loops 191
7.3 Try This! 194
7.4 More Discipline-Specific Practice 203
7.5 Chapter Review 203
7.5.1 Self-Test Questions 203
7.5.2 Chapter Summary 205
7.5.3 Self-Test Answers 207

8 Basic Prognostic Modeling 209


8.1 Example of a Basic Prognostic Model 209
8.2 Python Programming Essentials 217
8.2.1 Random Numbers in Computers 217
8.2.2 Scalar Boolean Type and Expressions 221
8.2.3 Nested Branching 230
8.2.4 Looping an Indefinite Number of Times Using while 232
8.2.5 Making Multiple Subplots 236
8.2.6 More on Nested Loops 237
8.2.7 Conditionals Using Floating-Point Numbers 239
8.3 Try This! 241
8.4 More Discipline-Specific Practice 252
8.5 Chapter Review 252
8.5.1 Self-Test Questions 252
8.5.2 Chapter Summary 254
8.5.3 Self-Test Answers 257
x Detailed Contents

9 Reading In and Writing Out Text Data 261


9.1 Example of Reading In and Writing Out Text Data 262
9.2 Python Programming Essentials 267
9.2.1 Introduction to Objects 268
9.2.2 Arrays as Objects 269
9.2.3 Lists as Objects 277
9.2.4 Strings as Objects 280
9.2.5 Copying Variables, Data, and Objects 286
9.2.6 Reading and Writing Files 290
9.2.7 Catching File Opening and Other Errors 298
9.3 Try This! 300
9.4 More Discipline-Specific Practice 317
9.5 Chapter Review 317
9.5.1 Self-Test Questions 317
9.5.2 Chapter Summary 319
9.5.3 Self-Test Answers 321

10 Managing Files, Directories, and Programs 327


10.1 Example of Managing Files, Directories, and Programs 328
10.2 Python Programming Essentials 331
10.2.1 Filenames, Paths, and the Working Directory 332
10.2.2 Making and Removing Empty Directories 335
10.2.3 Moving and Renaming Files and Directories 337
10.2.4 Copying and Deleting Files and Directories 338
10.2.5 Listing the Contents of a Directory 340
10.2.6 Testing to See What Kind of “File” Something Is 341
10.2.7 Running Non-Python Programs in Python 342
10.3 Try This! 343
10.4 More Discipline-Specific Practice 347
10.5 Chapter Review 347
10.5.1 Self-Test Questions 347
10.5.2 Chapter Summary 348
10.5.3 Self-Test Answers 350

Part II Doing More Complex Tasks 353


11 Segue: How to Write Programs 355
11.1 From Blank Screen to Program: A Process to Follow 355
11.2 The Importance of Testing 360
11.3 The Importance of Style Conventions 363
Detailed Contents xi

12 n-Dimensional Diagnostic Data Analysis 365


12.1 Example of n-Dimensional Diagnostic Data Analysis 365
12.2 Python Programming Essentials 367
12.2.1 The Shape of and Indexing n-Dimensional Arrays 368
12.2.2 Selecting Subarrays from n-Dimensional Arrays 370
12.2.3 Array Syntax and Functions in n-Dimensional Arrays 372
12.2.4 Reshaping n-Dimensional Arrays and Memory Locations of Array
Elements 374
12.2.5 Subarrays and Index Offset Operations 376
12.2.6 Triple Nested Loops and Mixing Array Syntax/Selection and Looping 378
12.2.7 Summary Table of Some Array Functions 380
12.3 Try This! 382
12.4 More Discipline-Specific Practice 386
12.5 Chapter Review 387
12.5.1 Self-Test Questions 387
12.5.2 Chapter Summary 389
12.5.3 Self-Test Answers 391

13 Basic Image Processing 394


13.1 Example of Image Processing 394
13.2 Python Programming Essentials 400
13.2.1 Reading, Displaying, and Writing Images in Matplotlib 401
13.2.2 Boolean Arrays 404
13.2.3 Array Syntax and Functions and Asking Questions of Data in Arrays 408
13.2.4 Performance of Looping and Array Syntax and Functions 414
13.2.5 The NumPy reduce Method 416
13.2.6 Looping Through Lists of Objects 417
13.3 Try This! 419
13.4 More Discipline-Specific Practice 430
13.5 Chapter Review 431
13.5.1 Self-Test Questions 431
13.5.2 Chapter Summary 432
13.5.3 Self-Test Answers 434

14 Contour Plots and Animation 439


14.1 Example of Making Contour Plots and Animations 440
14.2 Python Programming Essentials 445
14.2.1 An Introduction to Matplotlib’s Object API 446
14.2.2 Line and Shaded Contour Plots 451
14.2.3 Using cartopy to Overlay Maps 453
14.2.4 Basic Animation Using Matplotlib 456
14.2.5 Flexible Functions and Dictionaries 459
xii Detailed Contents

14.3 Try This! 465


14.4 More Discipline-Specific Practice 477
14.5 Chapter Review 477
14.5.1 Self-Test Questions 477
14.5.2 Chapter Summary 479
14.5.3 Self-Test Answers 481

15 Handling Missing Data 483


15.1 Example of Handling Missing Data 483
15.2 Python Programming Essentials 487
15.2.1 Approach 1: Define a Data Value as Missing and Process
with Boolean Arrays or Expressions 488
15.2.2 Approach 2: Use Series and IEEE NaN Values 490
15.2.3 Approach 3: Use Masked Arrays 492
15.2.4 Which Approach Is Better? 493
15.3 Try This! 494
15.4 More Discipline-Specific Practice 498
15.5 Chapter Review 498
15.5.1 Self-Test Questions 498
15.5.2 Chapter Summary 499
15.5.3 Self-Test Answers 501

Part III Advanced Programming Concepts 503


16 More Data and Execution Structures 505
16.1 Example of Using More Advanced Data and Execution Structures 505
16.1.1 Solution 1: Explicitly Call Functions and Store Results in Variables 506
16.1.2 Solution 2: Explicitly Call Functions and Store Results in Arrays 507
16.1.3 Solution 3: Explicitly Call Functions and Store Results in Dictionaries 508
16.1.4 Solution 4: Store Results and Functions in Dictionaries 509
16.2 Python Programming Essentials 511
16.2.1 More Data Structures 511
16.2.2 More Execution Structures 519
16.2.3 When to Use Different Data and Execution Structures 521
16.3 Try This! 523
16.4 More Discipline-Specific Practice 529
16.5 Chapter Review 530
16.5.1 Self-Test Questions 530
16.5.2 Chapter Summary 531
16.5.3 Self-Test Answers 533
Detailed Contents xiii

17 Classes and Inheritance 536


17.1 Examples of Classes and Inheritance 536
17.1.1 Scientific Modeling Example 537
17.1.2 Scientific Bibliography Example 544
17.2 Python Programming Essentials 546
17.2.1 Defining and Using a Class 546
17.2.2 Inheritance 550
17.2.3 More Sophisticated Sorting Using sorted 553
17.2.4 Why Create Our Own Classes? 554
17.2.5 Automating Handling of Objects and Modules 557
17.3 Try This! 560
17.4 More Discipline-Specific Practice 564
17.5 Chapter Review 564
17.5.1 Self-Test Questions 564
17.5.2 Chapter Summary 566
17.5.3 Self-Test Answers 568

18 More Ways of Storing Information in Files 570


18.1 Examples of Using Other File Formats 570
18.2 Python Programming Essentials 576
18.2.1 Excel Files 576
18.2.2 pickle Files 578
18.2.3 netCDF files 579
18.3 Try This! 583
18.4 More Discipline-Specific Practice 589
18.5 Chapter Review 589
18.5.1 Self-Test Questions 589
18.5.2 Chapter Summary 590
18.5.3 Self-Test Answers 592

19 Basic Searching and Sorting 595


19.1 Examples of Searching and Sorting 595
19.2 Python Programming Essentials 598
19.2.1 Summary of Some Ways to Search and Sort 598
19.2.2 Searching and Sorting Algorithms 601
19.2.3 Basic Searching and Sorting Using pandas 611
19.3 Try This! 622
19.4 More Discipline-Specific Practice 628
19.5 Chapter Review 628
19.5.1 Self-Test Questions 628
19.5.2 Chapter Summary 629
19.5.3 Self-Test Answers 631
xiv Detailed Contents

20 Recursion 633
20.1 Example of Recursion 633
20.2 Python Programming Essentials 635
20.2.1 Using the walk Generator 635
20.2.2 Recursion and Writing Recursive Code 637
20.2.3 More Applications of Recursion 642
20.3 Try This! 645
20.4 More Discipline-Specific Practice 649
20.5 Chapter Review 649
20.5.1 Self-Test Questions 649
20.5.2 Chapter Summary 650
20.5.3 Self-Test Answers 651

Part IV Going from a Program Working to Working Well 655


21 Make It Usable to Others: Documentation and Sphinx 657
21.1 Introduction 657
21.2 Principles of Documenting 657
21.3 General Convention for Docstrings: The NumPy Format 659
21.4 The Sphinx Documentation Generator 660

22 Make It Fast: Performance 666


22.1 Introduction 666
22.2 Preliminaries 666
22.2.1 Describing the Complexity of Code 666
22.2.2 Practices That Can Result in Inefficient Code 668
22.3 Finding the Bottlenecks Using Profilers 670
22.3.1 timeit 671
22.3.2 cProfile 672
22.3.3 line-profiler 674
22.3.4 memory-profiler 676
22.4 Fixing the Bottlenecks 678
22.4.1 Generators 678
22.4.2 Just-in-Time Compilation 680
22.5 Pitfalls When Trying to Improve Performance 682

23 Make It Correct: Linting and Unit Testing 683


23.1 Introduction 683
23.2 Linting 683
23.3 Unit Testing 686
23.3.1 unittest 687
23.3.2 pytest 688
23.4 The “Test-Driven Development” Process 690
Detailed Contents xv

24 Make It Manageable: Version Control and Build Management 693


24.1 Introduction 693
24.2 Version Control 693
24.2.1 Using Git as a Single User 694
24.2.2 Using Git as a User Who Is Part of a Collaboration 696
24.2.3 Using Git with Branching 697
24.3 Packaging 698
24.4 Build Management and Continuous Integration 699

25 Make It Talk to Other Languages 702


25.1 Introduction 702
25.2 Talking with Fortran Programs 702
25.3 Talking with C/C++ Programs 704

Appendix A List of Units 706

Appendix B Summary of Data Structures 708

Appendix C Contents by Programming Topic 709


C.1 Introductory Programming Topics 709
C.1.1 What Is a Program and General Elements of Python 709
C.1.2 Variables and Expressions 710
C.1.3 Typing and Some Basic Types 710
C.1.4 Strings 711
C.1.5 Functions 711
C.1.6 Branching, Conditionals, and Booleans 712
C.1.7 Looping 712
C.1.8 Console Input and Output 713
C.1.9 Text File Input and Output 713
C.1.10 Exceptions 713
C.1.11 Arrays 714
C.1.12 Classes 715
C.2 Intermediate Programming Topics 715
C.2.1 Abstract Data Types and Structures 715
C.2.2 Algorithm Analysis 716
C.2.3 Searching and Sorting 716
C.2.4 Recursion 717
C.3 Other Topics 717
C.3.1 How to Program and Programming Style 717
C.3.2 Distributions and Interactive Development Environments (IDEs) 717
Another Random Scribd Document
with Unrelated Content
The Project Gutenberg eBook of Village Folk-Tales
of Ceylon, Volume 1 (of 3)
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

Title: Village Folk-Tales of Ceylon, Volume 1 (of 3)

Translator: H. Parker

Release date: February 21, 2018 [eBook #56614]

Language: English

Credits: Produced by Jeroen Hellingman and the Online


Distributed
Proofreading Team at http://www.pgdp.net/ for Project
Gutenberg (This file was produced from images
generously
made available by The Internet Archive/American
Libraries.)

*** START OF THE PROJECT GUTENBERG EBOOK VILLAGE FOLK-


TALES OF CEYLON, VOLUME 1 (OF 3) ***
VILLAGE FOLK-TALES
OF CEYLON
VILLAGE FOLK-TALES OF
CEYLON
Vol. I

Collected and Translated by


H. PARKER
Late of the Irrigation Department, Ceylon

LONDON
LUZAC & CO
Publishers to the India Office
1910
[All Rights Reserved]

Butler & Tanner The Selwood Printing Works Frome and London
CONTENTS
PAGE

Introduction 1

PART I.

STORIES OF THE CULTIVATING CASTE AND VAEDDĀS.

NO.
1 The Making of the Great Earth 47
2 The Sun, the Moon, and Great Paddy 52
3 The Story of Senasurā 54
4 The Glass Princess 57
5 The Frog Prince 67
6 The Millet Trader 72
7 The Turtle Dove 79
8 The Prince and the Princess 93
9 Tamarind Ṭikkā 100
10 Mātalangē Loku-Appu 108
11 The White Turtle 113
12 The Black Storks’ Girl 120
13 The Golden Kaekiri Fruit 129
14 The Four Deaf Persons 134
15 The Prince and the Yakā 137
16 How a Yakā and a Man fought 146
17 Concerning a Man and Two Yakās 148
18 The Three Questions 150
19 The Faithless Princess 157
20 The Prince who did not go to School 160
21 Nagul-Munnā 169
22 The Kulē-bakā Flowers 173
23 Kurulu-gama Appu, the Soothsayer 179
24 How a Prince was chased by a Yaksanī 186
25 The Wicked King 191
26 The Kitul Seeds 197
27 The Speaking Horse 199
28 The Female Quail 201
29 The Pied Robin 206
30 The Jackal and the Hare 209
31 The Leopard and the Mouse-deer 213
32 The Crocodile’s Wedding 216
33 The Gamarāla’s Cakes 219
34 The Kinnarā and the Parrots 224
35 How a Jackal settled a Lawsuit 228
36 The Jackal and the Turtle 234
37 The Lion and the Turtle 241

PART II.

STORIES OF THE LOWER CASTES.

38 The Monkey and the Weaver-Bird (Potter) 247


39 The Jackal Dēvatāwā (Washerman) 249

STORIES OF THE TOM-TOM BEATERS.

The Foolishness of Tom-tom Beaters 252

40 A Kaḍambāwa Man’s Journey to Puttalam 253


41 The Kaḍambāwa Men and the Hares 255
42 The Kaḍambāwa Men and the Mouse-deer 256
43 The Kaḍambāwa Men and the Bush 257
44 How the Kaḍambāwa Men counted Themselves 258
45 The Kaḍambāwa Men and the Dream 260
46 The Four Tom-tom Beaters 262
47 The Golden Tree 264
48 The Seven Princesses 270
49 Mr. Janel Siññā 278
50 The Nikini Story 284
51 The Aet-kanda Lēniyā 291
52 The Wimalī Story 302
53 The Pots of Oil 304
54 The Mouse Maiden 308
55 Sīgiris Siññō, the Giant 312
56 The Proud Jackal 316

STORIES OF THE DURAYĀS.

57 The Seven Robbers 317


58 The Stupid Boy 319
59 The Gamarāla and the Washerman 322
60 The Two Thieves 330
61 The Margōsa Tree 334
62 The Gamarāla’s Foolish Son 336
63 The Jackal’s Judgment 339
64 The Heron and the Crab 342
65 The Jackal and the Brāhmaṇa 347
66 The Cat who guarded the Precepts 349
67 The Lizard and the Leopard 355
68 The Lion and the Jackal 359

STORIES OF THE ROḌIYĀS.

69 The Roll of Cotton 364


70 The Jackal and the Leopard 367
71 How the Boars killed the Rākshasa 370
72 The Grateful Jackal 373
STORIES OF THE KINNARĀS.

73 Concerning a Monk and a Yakā 375


74 The Three Suitors 378
75 The Crocodile and the Jackal 380

Index 383
INTRODUCTION
When the forest and jungle of north-central or north-western Ceylon
is viewed from the upper part of a hill of considerable height, it has
the appearance of a dark green sea, across which, if there be any
wind, waves closely resembling those of the ocean roll along in
parallel lines as the swaying tree tops bend under the gusts of the
breeze. As clouds pass between it and the sun their shadows of
darker green follow each other over this seemingly illimitable ocean.
The undulations of the ground are lost; all appears to be at one
general level, except that here and there a little island is visible
where a low rocky mound succeeds in raising its head above the
verdant waves.

Any hills of lower elevation than our post of observation look


strangely dwarfed, while higher ones behind us stand out more
prominently than ever. In the immediate neighbourhood, perhaps
glimpses may be obtained of one or two pale green rice fields,
contrasting with the darker foliage around them, and of the light
blue reflection of the sky in the water of a village tank; but further
away there is no break in the uniformity of the forest sea. No houses
are to be seen nor sounds heard, and the visible country appears to
be an uninhabited silent wilderness of vegetation.

Let us descend from such an elevated post, and proceed to examine


the depths of the green ocean at closer quarters. I shall assume that
the reader is accompanying me on a visit to a Kandian village, where
we can learn something of the mode of life and the ideas of the
dwellers in this jungle, and become acquainted with some of the
animals who are introduced into the stories which they relate.

We leave the dusty main roads, and follow a winding village path,
never straight for a hundred yards except by accident—not such a
path as was constantly encountered thirty or more years ago, on
which the overhanging thorny bushes often made it necessary to
bend low or run the risk of having one’s clothes torn, but a track
flanked with grass, having the bushes completely cleared away for a
width of twelve feet.

For a long distance we journey under an exhausting, pitiless, brazen


sun, which during all the middle part of the day the traveller feels
but never sees—never directing his gaze towards its blinding glare.
The heat is reflected from the unsheltered path. Shut out from the
cooling breath of the wind, we have on each side only closely
interlaced jungle, a tangled growth, consisting chiefly of leafy thorns
and creepers from ten to fifteen feet high, interspersed at varying
intervals with a few large trees. This is the wild growth that has
sprung up on the sites of abandoned chēnas or jungle clearings, and
will be cut down again for them from five to seven years afterwards.

An occasional recent example of such a clearing may be passed,


having a few large surviving scorched trees, and several smaller
ones, interspersed among the growing crop of green millet. Round
this a rough fence made by laying sticks and blackened sapling
trunks horizontally between pairs of crooked posts—part of the
unconsumed remains after the cut and dried up bushes had been
burnt—protects the crop from the intrusion of deer and pigs and
buffaloes.

Near the middle of the clearing, where two young trees grow in
proximity, two thin posts have been fixed in the ground, and
between these four supports a floor of sticks has been constructed
at a height of ten or twelve feet above the ground, reached by a
rough stick ladder with rungs two feet apart, and having a thatched
roof overhead, and a flimsy wall of sticks, interwoven with leafy
twigs or grass on the windward side. A thin floor of earth, watered
and beaten until it became hard, permits a small fire of sticks to be
made in the shelter if the nocturnal air be chilly. In this solitary
watch-hut a man, or sometimes two, sit or lie nightly, in order to
drive away intruding animals that may successfully evade or break
through the protecting fence, and feed on the crop.

In such clearings are cultivated chiefly millet of different sorts, or


edible grasses, sesame, and a small pulse called mun; while in the
richer soil around some scattered conical brown anthills are planted
maize, pumpkins, or red chillies, and a few small cucumbers called
kaekiri, bearing yellow or reddish fruit some six inches long.
Climbing up two or three of the smaller trees are to be seen gourds,
with their curious, hanging, pale, bottle-shaped fruit.

Along the path through the chēna jungle there are not many signs of
life. A Monitor Lizard or “Iguana,” about four feet long, which we
frighten as it was licking up ants and other insects on the roadside
with its extensile thin tongue, scurries off quickly, and disappears
down a hole in the side of an anthill. Over the jungle come the slow
monotonous calls, “Tok, tok, tok, tok,” of a small Barbet, perched on
the topmost twig of one of the higher trees, jerking its body to the
right and left as it repeats its single note. A Woodpecker crosses the
path with a screaming cry, three times repeated, and a few other
birds may appear at intervals, but otherwise there is not much to
break the sameness.

Then, if one be lucky, comes a tract of the original forest that has
escaped the chēna clearer’s destructive bill-hook and fires, in which
is immediately experienced the welcome relief afforded by the
delightful cool shade cast by the forest trees of many species which
stretch high above the lower bushes. This is the home of the
Elephant, traces of which are observed in the wide footprints and an
occasional broken-down sapling or fractured branch. A slightly
leaning tree on the side of the path has tempted one to rub his back
on it, and lower down are the scratches left by a Leopard’s claws, as
he scraped them on it like a cat.

As we pass along the leaf-strewn way, the loud hoarse cry, “Hō, hō,”
of the large grey Monkeys (Semnopithecus priamus) whom we
startle, resounds through the trees. They cease to feed on the
succulent young leaves, and shake the rustling branches in their bold
leaps among the higher ones. This is soon followed by a sudden
stillness as they mysteriously conceal themselves, vanishing as
though by magic among the denser foliage.

Bird calls unfamiliar to a stranger are heard, especially the short cry
of two notes, rather than the crow, of the Jungle-cock—the wild
game-fowl of Ceylon,—the sheep-like bleats of the Lesser Hornbill,
sometimes the rich notes of the Crested Drongo, or the often
reiterated whistle, “To meet ye´-ou,” of the Whistling Babbler. A
charming Ground Dove that was picking up seeds on the path, flies
off quickly down the path, and turns suddenly through the bushes. A
few white or brown or striped Butterflies, and sometimes the lovely,
large, dark velvety-green or steely blue Ornithoptera, flit about. A
few sharp notes, uttered as a small timid creature, little bigger than
a hare, darts off under the bushes, tell us that we have startled a
little Mouse-deer, Mīminnā. These fragile-looking animals always
stand on tiptoe, appearing exactly, as Mr. R. A. Sterndale expressed
it in his work, The Mammalia of India, “as if a puff of wind would
blow them away.” But as a rule, there is not much animal life
noticeable even in these forests, unless one can spare time to search
for it.

Another patch of the chēna jungle succeeds the forest, and then the
path reaches one end of the embankment of a village tank or
reservoir, a shallow sheet of water varying in size from two or three
acres to more than one hundred, but commonly from twenty to fifty
in area. The trim, earthen, grass-sloped embankment, nearly
straight, from an eighth of a mile to half a mile long, from nine to
sixteen feet high, and six feet wide on the top, rises a few feet
above the water level.

In its contrast with the parched and heated ground along which we
have come, the scene always appears strikingly beautiful. There are
few fairer spots on the earth than some of the village tanks when
they are nearly full of water. Here we may sit in the cool shelter of
an umbrageous tree, and contemplate nature in its most idyllic
aspect. The busy world, with its turmoil and stress, its noisy factories
and clanging machinery, its hurrying railway trains and motor-cars,
its crowded cities full of an artificial and unhealthy existence, has
disappeared, as though it had been merely a fantastic vision of the
night. Here all is peace: an uneventful calm that has survived the
changes of perhaps two thousand years, and that may be unaltered
in another two thousand. One may wonder if the fevered life of the
present western civilisation will last as long, or will have burnt itself
out, and been swept away like that of the dead civilisations that
preceded it.

Abandoning these day dreams, which the seclusion of the site


induces, we look around us. At both sides of the tank and along the
outer toe of the embankment grow lofty trees, with grey trunks
often strengthened by wide buttresses, which are thrown out so as
to afford their support in the direction in which it is chiefly needed. If
a branch become unduly expanded on one side of the tree, always
that on which it receives the rays of the sun, so as to displace the
centre of gravity, the trunk at once proceeds to develop these thin
triangular buttresses under it, wide at the base, and extending ten
or fifteen feet upward. As though designed by an engineer, there are
usually two which act as struts, and support the trunk below the
overweighted branch; and on the opposite side a broader one which
acts as a tie, and assists in holding back the stem.

There is no lack of varied forms of animal life here. Often a party of


brown Monkeys who have come to drink at the tank are to be seen
in some of the trees, sitting quietly inspecting the visitors, or walking
leisurely along the branches, a few of the females carrying under
their bodies a young one tightly clutching them.

In many tanks, a low grey or dark-stained rock in the water affords a


favourite basking ground for the sluggish muddy-brown Crocodiles
that make their home in all but a few of the smallest of these tanks.
They lie on it like stranded logs, exposed to the sun’s rays, often
with wide-open mouths, as though overcome by the heat, from
which, however, they make no effort to escape.

A few black Cormorants and a white Egret or two may also be there,
resting on another part of the rock; and close to the water even one
or two little Black Tank Turtles, but not the edible White Tank Turtle
(Kiri-ibbā), which is much less common. On a stump in the water is
usually perched a Darter, a bird that can outswim its fishy prey, with
long snake-like neck, drying its expanded wings under the fiery
tropical rays. Its mate will be immersed in the water, in which it
swims with only its head and neck visible above the surface.

Near the upper margin of the tank wades, with long deliberate
strides, a lanky Great White Egret (Herodias alba), its neck
outstretched in advance, and head held ready for a rapid spear-like
thrust of its long tapering bill at any frog or small fish incautious
enough to remain within its fatal reach. Nearer the edge of the
shallowest water Lesser Egrets step more hurriedly in search of
frogs, and often chase them as they rush spluttering along its
surface.

At the larger tanks the hoarse scream of a White-tailed Fishing Eagle


(Polioaetus ichthyaetus), perched on one of the higher branches of a
tall tree overhanging the water, resounds across the open space,
without frightening a flock of reddish-brown Whistling Teal that float
motionless near some lotus leaves, watching the human intruders,
who monopolise all their attention.

As we proceed along the embankment, we disturb some of the large


Frogs that were sunning themselves on it, or catching flies near the
edge of the water, and that plunge headlong into it with extended
hind legs.

We now perceive on the low side of the tank a stretch of fields, a


couple of hundred yards, a quarter of a mile, or half a mile long, or
even more, in which the clear uniform light green sheet of the paddy
or growing rice affords a pleasant relief after the uninteresting chēna
jungle. A long group of feathery-fronded Coconut trees near the
tank, fringing the far side of the field, indicates that we are close to
a Kandian village. The thatched grey roofs of some of the houses are
soon distinguishable below the palms, nearly concealed among the
plantain trees and other bushes growing about them. Above these
stand out several tall, deep green, pointed-leaved Mango trees, and
higher still a few wide-spreading Tamarinds and slender Halmilla
trees.

Before we reach them, our attention is again arrested by the


repeated mewing calls of the light-coloured Jacanas
(Hydrophasianus chirurgus), with pheasant-like tails and enormously
lengthened toes, which distribute their weight over a wide area. This
enables them to walk on the round floating leaves of the lotus plants
that cover one portion of the tank, picking unwary insects out of the
water.

Near the side of the tank are to be seen the upper parts of the dark
heads of buffaloes, of which the bodies are immersed, as they lazily
chew the cud. A White Egret is perched on one whose back appears
above the water. At intervals a head disappears quietly below the
surface, and the dense crowd of small flies that had settled on it is
driven to flight, only to return once more as soon as it rises again.

In the shallower water near them, and nearly stationary, or moving a


few feet only at a time, stands a small silent Pond Heron (Ardeola
grayi), avoiding observation as much as possible. Its shoulders are
raised, and its head is drawn down, so that it appears to have no
neck; its dorsal plumes spread over the closed wings and completely
hide them. When it stands still in this, its usual, attitude it is almost
unnoticeable among the aquatic weeds. On our approach it flies off
with a croak, transformed into a bird displaying broad white wings
and a long thin neck. It is far from being the voracious bird that a
well-known tale represents it to be.
A Chestnut Bittern (Ardetta cinnamomea), that had stationed itself at
the foot of the embankment, flits silently across the water, and a
Blue or Pied Kingfisher is seen poising itself with down-turned bill,
over a shoal of small fishes, on which it drops unexpectedly with a
sudden splash, and then wings its way to another position where
others have been detected.

On a patch of grass at the upper side of the tank we observe a


couple of white-necked Black Storks (Ciconia leucocephala)
promenading sedately in search of luckless frogs, but maintaining a
careful watch for human enemies who may be tempted to
endeavour to approach within gunshot.

Near this end of the embankment, a party of village women who


have brought their large, narrow-mouthed, brown earthen pots or
“chatties” for water, holding them on their hips by passing an arm
round the neck, will probably take to flight on seeing the white
strangers, or otherwise stand as far off the path as the space
permits, until they pass. A cry of rapidly shouted words is repeated
through the village, announcing the arrival of “gentlemen,” and soon
some of the men emerge, and after saluting us with hands raised to
the chest and palms touching each other, guide us into it.

On our way we pass by single houses or groups of two or three,


built in the midst of each little paddock, fifty or one hundred feet
wide or more, often with a very slight fence around it, of the
scattered area under the coconut palms which forms the gardens of
the Kandian village. Decently clad men and women come out of their
mud-walled and often whitewashed dwellings to stare at the
strangers, as well as children of all sizes, in varying stages of scanty
clothing, from a short piece of white calico which reaches from the
waist to the ankles, down to its vanishing point. The men wear a
plain white cloth from the waist to the ankles. The women have a
white or coloured one about twelve feet long, one end passing from
the waist over the front of the figure, with the corner thrown over
the right shoulder, and hanging down behind as far as the waist; the
rest of the cloth is wrapped twice round the lower part of the figure,
from the waist downwards. When they visit other villages many of
the people of both sexes wear white jackets; in the women’s jackets
the sleeves are gathered and puffed out at the shoulder, and reach
only to the elbow, and there is a wide, sometimes frilled, double
collar.

Our guides lead us on until we reach a dwelling possibly a little more


carefully constructed than the others, close to which is a thatched,
open, rectangular shed, about twelve feet long by nine feet wide,
with its roof resting on plain round wooden posts. Its raised earthen
floor is hastily swept, a heavy wooden mortar cut out of a piece of
tree trunk, and used for pounding rice in order to remove the skin, is
rolled away, and the shed is then ready for our temporary
occupation.

This is a maḍuwa, or shed erected for travellers and strangers, as


well as for the general use of the owner, in which the women may
plait mats, or clean paddy or rice in the wooden mortar, with a long
wooden pestle having an iron ring round the lower end. Here also
the man’s friends may sit and chat, and chew the leaf of the Betel
vine with broken-up bits of the nut of the Areka Palm, and a little
lime, and a fragment of tobacco leaf, while they discuss the state of
the crops, or the local news.

When such a shed is erected on the side of a path for public use, it
may have, but rarely, half walls four feet high; or the posts may be
tenoned into a rectangle of substantial squared logs that are halved
into each other at the angles, where they rest upon large stones, so
as to be clear of the ground, and thus partly protected from attacks
by white ants. The squared beams act as seats for the tired passer-
by.

At the end of the maḍuwa in the village there is sometimes a very


small room of the same width, in which is stored millet or pulse in
bags, or ash-pumpkins, together with a few articles required about
the house, such as surplus grass mats, and flat winnowing baskets.
Under the roof of the maḍuwa, above the cross-beams and some
sticks laid on them, will be the owner’s little plough, and board for
levelling the mud of the rice field before sowing, and some short
coils of rope made from the twisted inner bark of tough creepers,
and one or two fish creels.

When there is no suitable shed of this kind for the visitor, a hut,
usually one belonging to the village headman, is swept out and
temporarily given up to our use. If information of the coming visit
had been sent beforehand, the hut or shed would have been
provided with a ceiling made of lengths of white calico borrowed
from the family washerman, and perhaps the walls also would have
been hung with others, sometimes including such coloured ones as
he had washed for some of the villagers.

While food is being prepared by our servants in a small shed or


kitchen close to the house, we stroll through the village, and observe
as we go that all the houses lie east and west, or north and south,
and are thatched with straw or plaited Coconut leaves. They are all
rectangular, usually eight or nine feet wide and some twelve feet
long, and are raised a couple of feet from the ground, on a solid
earthen foundation. Each one has a low veranda, two feet six inches
or three feet wide, along the front side, and one heavy door of
adzed or sawn timber near the middle; but there is very rarely a
window, and even then only one of the smallest size.

Near the end of the house, and within sight of the veranda, there
are one or two round corn stores, considerably wider at the top than
at the base, with conical thatched roofs. They rest upon cross sticks
placed upon four horizontal adzed logs, which are supported by four
small rough blocks of stone at the corners. Their walls are made of a
wicker frame hung from four or five durable posts set in the ground,
which are usually the heart wood of trees that are not eaten by
white ants. The upper part of the wicker frame is firmly tied to the
tops of these, and the whole wicker work is then thickly overlaid and
stiffened by successive coatings of mixed clay and sand, on which,
as on all the walls and floor of the dwelling house, there is placed a
thin surface wash of cow-dung.

These corn stores contain the household supply of paddy or millet.


They are entered only by raising the loose conical roof on one side
by a long prop, and getting inside by means of a rough ladder, at the
opening thus made, over the top of the wall, which rises eight or
nine feet above the ground. Sometimes, but rarely in the northern
Kandian districts, a small rectangular hut is used as a corn store, the
entrance in that case being made through a doorway in the middle
of one side.

The open ground along the front of the house is clean, and free
from grass and weeds, and is swept every morning. In this space,
called the miḍula, there is a stand of peeled sticks supported on thin
posts, and having a stick platform about four feet, or a little more, in
length and two feet in width, raised three feet from the ground, with
often another similar platform below it. On these are laid, after being
washed, the blackened earthenware cooking pots of the house, and
spoons made of segments of coconut shell with long wooden
handles, which are used with them.

In the little kitchen at the end of the house, with a lean-to roof, the
hearths or fire-places called lipa are formed of three round stones
fixed on the ground, about eight inches apart, on which are set the
cooking pots, over a fire of dry sticks. Sometimes a separate small
shed is built as a kitchen, but often the cooking is done inside the
single apartment of the house, at one end of it.

In each garden are a number of Coconut trees, some thin Halmilla


trees, and often a Mango tree, or a dark-leaved Jak tree, with its
enormous light green fruit hanging on pedicles from the trunk or
larger branches, as well as a Lime tree, and four or five clumps of
Plantain stems nearer the dwelling. Round the base of one or two of
the Coconuts or Halmilla trees are piled on end long bundles of
firewood, nearly two feet thick and six or eight feet long, the
unconsumed sticks from the chēna, collected by the women, tied
round with creepers, and carried home on their heads. Climbing up a
small tree in front of the house is a fine Betel vine, which is watered
every day during the dry weather. We notice that a bleached skull of
a bull is fixed among the leaves to guard the creeper from the
unlucky glance of the “Evil Eye,” which might cause its premature
decay. In the damper ground adjoining the rice field a few slender
Areka palms are growing, with their clusters of small fruit hanging
below their leafy crowns.

On the outer side of the village, near the embankment of the tank,
there are the large, rough-stemmed Tamarind trees that we noticed
as we came. A number of separate thin posts are fixed in the bare
ground below them, to which are tethered a few small Buffalo
calves, which will be joined by their mothers at dusk, after their bath
in the tank is finished.

Further on, there is a small enclosure protected by a stick fence,


round which a few thorns are placed. At the entrance, the halves of
a split log, about nine inches wide, form gate posts; and five
moveable horizontal bars pass easily through holes cut through
them, a few loose thorns being rolled against them when the
enclosure is shut up at night. This is a cattle-fold, or gāla, into which
the little harmless black humped cattle are driven each evening by
some boys, with the repeated long-drawn cry, Gālē, “Into the fold.”
In some districts tobacco or chillies will be planted on this well-
manured plot of ground in the following spring, a new cattle fold
being then made.

On our return to the shed we see that our host’s wife has cooked his
evening meal of boiled rice and vegetable curry, with a bit of sun-
dried fish as a flavouring, these last being often made burning hot
with red chillies. She serves it in the raised veranda to him and a
relative who has come from a distant village, after giving them water
for rinsing out their mouths. Both sit or “squat” on their heels, and
convey the food to their mouths with their right hands, out of the
shallow, rather wide basins that act as plates. Where the supply of
such household articles runs short, leaf plates made of a piece of
plantain leaf, or two or three halmilla leaves pinned together, are
used. When they have finished the meal, and have rinsed their right
hands and drunk water—which is never taken while eating—and
have been served with a chew of betel leaf and its accompaniments,
the wife eats the remains of the meal alone, inside the house. If she
and her husband were alone they would take it together, the
husband being first served.

The men now sit on mats spread in the narrow veranda, where a
little oil lamp is perhaps hung, and the woman, after throwing out
the remains of the food for the dog, and washing the basins and
cooking utensils, and arranging them on their stand, joins the party,
and shares in the evening’s conversation. Sometimes, however, she
finds it necessary to pound some paddy until bed-time, in order to
remove the husk, in readiness for the meals of the following day; or
millet or rice may require grinding into flour in the stone quern.

If some intimate village friends were there, this would be the time
when, after discussing the events of the day, or making
arrangements for the morrow, a member of the party might finish
the evening’s chat by relating one of the familiar old stories of which
translations appear in this book.

In the end the woman retires, the visitor stretches himself on his
grass mat in the veranda, and the host extinguishes the lamp, if one
had been lit, and enters the single room of his house. On the next
night it will be his turn to occupy the watch-hut at the chena, where
his partner is sitting now.

All take care to lie, if possible, in an east and west direction, and on
no account with their heads to the south. This is the abode of Yama,
the god of death, while the north is the quarter inhabited by
demons. These directions are therefore exposed to evil influences
which might affect the sleeper, and perhaps cause such unlucky
omens as evil dreams.

The dog curls himself on the ground at the front of the house, the
cat wanders off to join some village cronies, and all is silent in the
village, except the rustling of the Coconut fronds overhead, the
monotonous call, “Wuk; chok-chŏ-tok,” uttered by a small owl in one
of the higher trees, and the more distant chorus of the frogs in the
adjoining rice field.

Now and again we hear at some villages the long-drawn, human-like


cry, “Hōō, hōō, hōō,” of a large Wood-Owl (Syrnium indranee), that
is flying round high in the air, and answering its distant mate. It is a
weird unearthly sound, which is always firmly believed by the
villagers to be uttered by demons, as will be noticed in some of the
stories.

The earliest cry of the morning is the deep booming note, three or
four times repeated, of the large Ground Cuckoo (Centrococcyx
rufipennis), which is heard soon after dawn appears. Our host’s wife
is at work before daylight, scraping into shreds the kernel of a half
coconut, and preparing some milk-rice—rice boiled in milk made by
squeezing grated coconut in water until the latter assumes the
colour of milk.

By sun-rise, the Crows of the village are astir, and the Parrakeets,
commonly called “Parrots” in the East, which have been sleeping in
the coconut trees, fly away in parties in search of food.

The notes of the double kettle-drum at a neighbouring wihāra, or


Buddhist temple, consisting of three deep-toned strokes at short
intervals, followed by five rapid blows on a higher key, once
repeated, the whole series being many times sounded, now
announce to the villagers within hearing that this is one of the four
Pōya days of the month, the Buddhist Sabbath, kept at each of the
quarters of the moon.
About an hour later, our host’s wife is joined by a party of eight or
ten women, and one or two men, all dressed in clean white clothes.
They proceed to the temple, each carrying in a small bowl a present
of milk-rice and a few cakes, covered with a white cloth. There they
chant three times, after the resident monk, the Buddhist creed, “I go
to the Buddha-refuge, I go to the Faith-refuge, I go to the
Community (of Monks)-refuge”; this is followed by some more
stanzas in the ancient language, Pāli, after which they return, and
resume the ordinary occupations of the day.

Our host is about to leave his room after his night’s rest, when the
chirp of a little pale-coloured House Lizard on the wall causes him to
turn back suddenly, in order to avoid the evil influences against
which the wise Lizard had uttered its warning voice. He occupies
himself in the house for a short time longer, and then, at a luckier
moment, makes his appearance afresh, taking care to step over the
threshold with the right foot first.

He is cheered by finding that nothing obstructs his way in the least


after he comes out, and that we are the first living beings on which
his gaze rests. To begin the day by seeing first a person of superior
status is a lucky omen of the favourable character of the rest of the
day, and one with which he is not often blessed. We increase the
auspicious impression by a few judicious friendly remarks; but are
careful not to offer any decided praise regarding any of his
possessions, since we are aware of his opinion that one never knows
if such sayings may not have a reverse effect through the
malevolence of jealous evil spirits. There is an Evil Mouth, as well as
an Evil Eye.

A man or two, and a few boys, come from the adjoining houses to
watch our doings, from the open space in front of the house, or the
veranda; but all turn their faces away and ignore us from the
moment when we sit down to our “early tea,” and until it is finished.
This is done so as to avoid any risk of our food’s affecting us
injuriously, owing to a possible glance of the Evil Eye, which a
person may possess without being aware of the fact.

We notice a little copper tube slung on the right upper arm of our
host’s wife, by means of a yellow thread which passes through two
rings on its under side. In reply to our carefully worded inquiry
regarding it, he informs us that as she had been troubled with evil
dreams they had thought it advisable to get a friend of his, a
Vedarāla or doctor, who was acquainted with astrological and
magical lore, to supply her with a magical diagram and spell against
dreams, inscribed on a strip of dried palm leaf, which was rolled up
and placed in the tube. The thread, a triple one, was coloured with
saffron, and nine knots were made on it before it was tied on her
arm, a magical spell being repeated as each knot was made. Thanks
to this safeguard the dreams had ceased, but it was considered
advisable not to remove the thread and charm for a few weeks
longer.

Our host’s relative, having eaten some milk-rice, and taken a chew
of betel and areka-nut in his mouth, is about to return to his distant
village, and now leaves, saying only, “Well, I am going.” “It is good;
having gone come,” is the reply. The latter word must not be
omitted, or it might appear that his return in the future was not
desired.

So he sets off on his journey, the host accompanying him to the


garden fence. However, in a few minutes he is back again, and
explains that he had met with a bad omen which made it necessary
to postpone the departure. A dog stood in the path, obstructing his
way, and made no attempt to move even when he spoke to it. The
host cordially agrees that it would be most unwise to continue the
journey after such an unfavourable omen on starting, and it is
settled that he will leave early in the afternoon, when the danger,
whatever it may be, probably will have passed away.

You might also like