SlideShare a Scribd company logo
Making use of Python 1st Edition Rashi Gupta pdf
download
https://ebookgate.com/product/making-use-of-python-1st-edition-
rashi-gupta/
Get Instant Ebook Downloads – Browse at https://ebookgate.com
Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...
Rashi 1st Edition Avraham Grossman
https://ebookgate.com/product/rashi-1st-edition-avraham-grossman/
Methamphetamine A Love Story 1st Edition Rashi K.
Shukla
https://ebookgate.com/product/methamphetamine-a-love-story-1st-
edition-rashi-k-shukla/
Doing Math with Python Use Programming to Explore
Algebra Statistics Calculus and More 1st Edition Amit
Saha
https://ebookgate.com/product/doing-math-with-python-use-
programming-to-explore-algebra-statistics-calculus-and-more-1st-
edition-amit-saha/
Clinical Atlas of Polysomnography 1st Edition Ravi
Gupta
https://ebookgate.com/product/clinical-atlas-of-
polysomnography-1st-edition-ravi-gupta/
Surgical Management of Vitiligo 1st Edition Somesh
Gupta
https://ebookgate.com/product/surgical-management-of-
vitiligo-1st-edition-somesh-gupta/
Python Tricks A Buffet of Awesome Python Features Dan
Bader
https://ebookgate.com/product/python-tricks-a-buffet-of-awesome-
python-features-dan-bader/
Extractive Metallurgy of Rare Earths 1st Edition C.K.
Gupta
https://ebookgate.com/product/extractive-metallurgy-of-rare-
earths-1st-edition-c-k-gupta/
Learning BeagleBone Python Programming Unleash the
potential of BeagleBone using Python 1st Edition Hiam
https://ebookgate.com/product/learning-beaglebone-python-
programming-unleash-the-potential-of-beaglebone-using-python-1st-
edition-hiam/
Biotechnology of Fungal Genes 1st Edition V. K. Gupta
(Editor)
https://ebookgate.com/product/biotechnology-of-fungal-genes-1st-
edition-v-k-gupta-editor/
Making use of Python 1st Edition Rashi Gupta
Making Use of Python
Making use of Python 1st Edition Rashi Gupta
Wiley Publishing, Inc.
Rashi Gupta
Making Use of Python
Publisher: Robert Ipsen
Editor: Ben Ryan
Managing Editor: Angela Smith
New Media Editor: Brian Snapp
Text Design & Composition: John Wiley Composition Services
Designations used by companies to distinguish their products are often claimed as trade-
marks. In all instances where John Wiley & Sons, Inc., is aware of a claim, the product names
appear in initial capital or ALL CAPITAL LETTERS. Readers, however, should contact the appro-
priate companies for more complete information regarding trademarks and registration.
This book is printed on acid-free paper. ∞
Copyright © 2002 by Rashi Gupta. All rights reserved.
Published by Wiley Publishing, Inc., New York.
Published simultaneously in Canada.
No part of this publication may be reproduced, stored in a retrieval system or transmitted
in any form or by any means, electronic, mechanical, photocopying, recording, scanning or
otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copy-
right Act, without either the prior written permission of the Publisher, or authorization
through payment of the appropriate per-copy fee to the Copyright Clearance Center,
222 Rosewood Drive, Danvers, MA01923, (978) 750-8400, fax (978) 750-4744. Requests to the
Publisher for permission should be addressed to the Permissions Department, John Wiley
& Sons, Inc., 605 Third Avenue, New York, NY 10158-0012, (212) 850-6011, fax (212) 850-6008,
E-Mail: PERMREQ @ WILEY.COM.
This publication is designed to provide accurate and authoritative information in regard to
the subject matter covered. It is sold with the understanding that the publisher is not
engaged in professional services. If professional advice or other expert assistance is required,
the services of a competent professional person should be sought.
Library of Congress Cataloging-in-Publication Data:
ISBN: 0471-21975-4
Wiley also publishes its books in a variety of electronic formats. Some content that appears
in print may not be available in electronic books.
Printed in the United States of America.
10 9 8 7 6 5 4 3 2 1
Introduction xi
Scenario xxiii
Chapter 1 An Introduction to Python 1
Getting Started 1
Understanding Requirements 2
Determine Requirements of the University 2
Obtain Python and Its Documentation 3
Determine the System Requirements 4
Install Python 5
Start Python in Different Execution Modes 7
Summary 12
Chapter 2 Getting Started with Python 13
Getting Started 14
Writing Your First Python Program 14
Comments 15
Python as a Calculator 16
Using Variables in Python 16
Variables 17
Assigning Values to Variables 18
Standard Types 19
Identifiers and Keywords 39
Memory Management 40
Create a Sequence to Store All the Names of the Students 42
Write the Code to Display the Names of the Students 42
Contents
v
Declare a Dictionary of Student Purchases with the
Names of the Students as the Key 43
Write the Code to Display the Student Purchases 43
Save and Execute the Code 43
Verify the Details 44
Summary 44
Chapter 3 Intrinsic Operations and Input/Output 47
Getting Started 48
Using Input/Output Features and Intrinsic Operations
for Data Types in Python 48
Identify the Variables to Be Used 49
Accepting User Input 49
Formatting the Output 50
Introduction to Intrinsic Operations 55
Intrinsic Operations for Numeric Data Types 57
Intrinsic Operations for Strings 60
Intrinsic Operations for Lists and Tuples 66
Write the Code 71
Execute the Code 71
Summary 73
Chapter 4 Programming Basics 75
Getting Started 76
Conditional Operators 76
Order of Precedence of Operators 82
Using Programming Constructs 83
Identify the Control and Loop Statements to Be Used 84
Write the Code 94
Execute the Code 95
Summary 97
Chapter 5 Functions 99
Getting Started 100
Using Functions 100
Functions 101
Scope of Variables 118
Identify the Functions to Be Used 119
Write the Code 119
Execute the Code 121
Summary 122
Chapter 6 Modules 123
Getting Started 124
Using Modules 124
Modules 124
Packages 135
Identify the Modules to Be Used 136
vi Contents
Write the Code 137
Execute the Code 139
Summary 140
Chapter 7 Files 141
Getting Started 141
Using File Objects 142
Identify the Functions and Methods to Be Used 142
Write the Code to Store Course Details to the File 154
Execute the Code 155
Verify the Solution 155
Summary 156
Chapter 8 Object-Oriented Programming 157
Getting Started 158
Introducing OOP 158
Components of OOP 159
Benefits of OOP 160
Using Classes 161
Identify the Classes to Be Defined 162
Identifying the Class Objects 163
Identifying the Classes to Be Inherited and Their Objects 170
Identify the Methods to Be Overridden 173
Write the Code 182
Execute the Code 189
Summary 190
Chapter 9 Exception Handling 193
Getting Started 193
Handling Exceptions 194
Identify the Type of Error and Where the Error Occurs 196
Identify the Mechanism of Trapping the Exception 200
Identify the Location for the Code for Handling
the Exception to Be Written 209
Write the Code for Handling the Exception 209
Save and Execute the Code 210
Summary 210
Chapter 10 CGI Programming 213
Getting Started 213
Internet Basics 214
World Wide Web 217
Web Browsers 217
Hypertext Transfer Protocol (HTTP) 220
Revising HTML 221
Client-Side versus Server-Side Scripting 227
An Introduction to CGI 229
Contents vii
Writing CGI Applications 231
Write the Code for the HTML Form to Accept Data
from the User 231
Write the CGI Program in Python to Generate the
Results Page 232
Write the CGI Program to Generate Both the Form and
Results Pages 236
Execute the Code 237
Summary 239
Chapter 11 Database Programming 241
Getting Started 241
Database Management 242
Introduction to MySQL 243
Working with MySQL 246
Accessing a Database from a Python Script 254
Identify the Elements of the Table That Stores
Registration Details 256
Identify the Steps for Connecting to the Database 256
Write the Code to Create a Table in the Database 259
Write the Code to Insert the Registration Details
into the Table Created 260
Execute the Code to Create the Table in the Database 261
Execute the Code to Insert Data into the Table 261
Verify the Data in the Database 263
Summary 264
Chapter 12 Network Programming 267
Getting Started 267
Client/Server Architecture 268
Network Programming 269
Using Sockets 272
Identify the Sockets to Be Used 272
Write the Code to Run on the IT Department Computer 287
Write the Code to Run on the Admission Office Computer 288
Execute the Code Created for the IT Department Computer 289
Execute the Code Created for the Admission
Office Computer 290
Verify that Data Has Been Saved to a File in the
IT Department Computer 292
Summary 292
Chapter 13 Multithreaded Programming 297
Getting Started 297
Single-Threaded Applications 298
Threading in Python 299
viii Contents
Creating Multithreaded Applications 300
Identify the Class and the Methods to Create
a Multithreaded Application 300
Write Code for the Server 308
Write the Code for the Client 309
Execute the Code Created for the Server 310
Execute the Code Created for the Client 311
Summary 313
Chapter 14 Advanced Web Programming 315
Getting Started 316
Creating Web Servers 316
Accessing URLs 323
Creating Advanced CGI Applications 328
Identify the Elements of the Web Page for Entering
Assignment Details and Uploading the File 328
Identify the Methodology for Uploading the File 329
Identify the Methodology for Storing User Information 330
Write the Code for the CGI Script 335
Execute the CGI Script 339
Summary 340
Chapter 15 GUI Programming with Tkinter 343
Getting Started 343
Introduction to Tkinter 344
Creating a GUI Application 347
Identify the Components of the User Interface 348
Identify the Tkinter Widgets to Design the User Interface 348
Write the Code for the User Interface 360
Execute the Code 362
Summary 364
Appendix A Distributing COM Objects 365
Basics of COM 365
The Binary Standard 367
COM Interfaces 369
Binding 370
Python and COM 371
Creating COM Clients 371
Creating COM Servers 373
Index 377
Contents ix
Making use of Python 1st Edition Rashi Gupta
In this competitive age, high productivity, tight deadlines, and short development
cycles are the buzzwords in the application development world. These are the reasons
why software developers prefer rapid application development (RAD) tools like
Python.
Python is a portable, interpreted, object-oriented programming language. It com-
bines remarkable power with very clear syntax. Moreover, its high-level built-in data
structures, combined with dynamic typing and dynamic binding, make it very attrac-
tive for rapid application development.
Python is being used successfully to glue together large software components. It
spans multiple platforms, middleware products, and application domains. Python has
been around since 1991, and it has a very active user community.
Python can fulfill an important integration role in the design of large applications with a
long life expectancy. It allows a fast response to changes in user requirements that require
adapting the higher-level application logic without changing the fundamental underlying
components. It also allows quick adaptation of the application to changes in the under-
lying components.
Guido van Rossum, CNRI
Python is an easy to learn, powerful programming language. It has efficient high-level
data structures and a simple but effective approach to object-oriented programming.
Python’s elegant syntax and dynamic typing, together with its interpreted nature, make
it an ideal language for scripting and rapid application development in many areas on
most platforms.
www.python.org
This book is an attempt to bridge the ever-increasing gap between the market
demand and the availability of Python expertise. The first step to becoming an expert
is acquiring an in-depth knowledge of Python, and that is exactly what this book has
to offer. It begins with the basics of scripting and seamlessly moves to programming
intricacies.
Introduction
xi
Along with conceptual information this book will also provide extensive practical
exercises for the reader to gain valuable, real-life exposure to creating different types of
applications.
Overview of Python
Python is a free, open-source, general-purpose, interpreted, and powerful scripting
language for Web applications. It is an easy yet powerful programming language that
provides structure and support for large applications as well as the power and com-
plexity of traditional high-level languages. Python is the ideal choice if you require a
single language with the features of both an interpreted and a scripting language.
History of Python
Python is directly derived from the scripting language ABC, which was mainly used
for teaching purposes in the 1980s by a small number of people. Python’s development
was triggered by the need to develop tools to automate monotonous and time-
consuming tasks.
Guido van Rossum is the creator of Python. He started work on Python in late 1989
at CWI in Amsterdam. When Guido started work on Python, he was a researcher at
CWI. Initially, Python was designed to perform general administration tasks. Later, it
became a part of the Amoeba project at CWI and was first released for public use in
February 1991. A large part of Python development occurred at CNRI in Reston, Vir-
ginia, in the United States. In June 2000, the Python development team moved to
Pythonlabs, a member organization of the BeOpen network. The lead developers of
Python, including Guido van Rossum, maintained Pythonlabs. In October 2000, the
lead developers left BeOpen.com and joined Digital Creations. Since then the team has
been involved in Python development. Any intellectual property that is added to
Python is taken care by a nonprofit organization called Python Software Foundation.
Features of Python
Python can act as a connecting language that links many separate software compo-
nents in a simple and flexible manner. It can also act as a guiding language in which
high-level Python modules control low-level operations implemented by libraries in
other languages. Due to its ease of learning and strength to develop large applications,
it can serve both as a learner’s first programming language and as an interface for
users who want to become experts in advanced application development. Let’s discuss
some of the salient features of Python.
Easy
Python has an easy syntax, clean and simple semantics, and relatively few keywords,
which allow a new developer to learn Python very quickly and easily. It will require a
lesser effort for people who have some programming knowledge. Python has a syntax
xii Introduction
that is similar to that of Algol, C, and Pascal. In fact, it is a simplification of these lan-
guages and does not require any extra effort to learn an unfamiliar concept, syntax, or
keywords. Python is an object-oriented programming (OOP) language, but unlike
C++, OOP is not a mandatory concept for Python. You can start learning Python and
learn about OOP at a convenient point.
Moreover, Python does not have extra symbols for starting and ending code blocks,
defining an end to a statement, and pattern matching. Symbols such as curly braces
({}), dollar signs ($), semicolons (;), tildes (~), and at symbols (@), which are part and
parcel of many programming languages, do not constrain code written in Python.
Indentation is used to group statements to form code blocks. Therefore, you are less
likely to have bugs in your code due to incorrect indentations. Python is so simple to
understand that a reader who has never seen a single line of code can understand a
basic code written in Python.
Scalable
Unix shell scripting languages are fairly easy and can handle simple tasks very easily
and efficiently. When you add more features to a script, however, the script becomes
very large, complicated, and slow. You are unable to reuse your code, and even small
projects require huge scripts. Python provides a better structure and support for large
programs than shell scripting. You can build on your code from one project to another
or plug or create new components by reusing the existing code. The term “scalability”
in relation to Python refers to Python’s capability to provide ingredients to build an
application and to provide pluggable and modular architecture for the applications
that need to incorporate more functionality.
Python allows you to split your script into modules and reuse these modules in
other Python programs. Many standard modules, which can be used based on the
requirements of the program, are also built into Python. Many built-in modules aid
you in input/output, system calls, socket programming, and GUI programming, such
as Tkinter.
High Level
Consider that you have a shell script and you want to add a feature to it. It is possible
that the feature involves a system call, variable-length strings, or other data types that
are easy to implement in shell but will involve long code passages in C. Perhaps you
are not adequately familiar with C to write complex code. Python takes care of all these
issues. Python has built-in modules that help you make system calls. Useful, high-level
data types, such as lists (resizable arrays) and dictionaries (hash tables) are built into
Python, allowing you to express complicated expressions in a single statement. No
variable or argument declaration is necessary.After a value is assigned to a name, Python
instantly assumes the required type. All this minimizes the time and effort required to
implement a particular functionality in a program. The data types also reduce the code
size, resulting in a more comprehensible code. On the other hand, these data types
would be difficult to implement in C due to the required use of data structures and
pointers and the repetitive code needed to implement every large application.
Introduction xiii
Object Oriented
As stated earlier, OOP is a concept that is not imposed in Python right from the begin-
ning. Nonetheless, Python is a truly object-oriented language and provides features of
other structured and procedural languages. All components in Python are objects.
Python allows object orientation with multiple inheritance and late binding. You can
create object-oriented class hierarchies, and every attribute is referred to in name.
attribute notation. In this notation, an attribute is determined dynamically at run time.
Python also supports polymorphism—that is, Python callable objects can accept
optional arguments, keyword arguments, or an unlimited number of arguments. The
same operator can have different meanings according to the elements being refer-
enced. These features allow complex operations to be implemented in small Python
declarations. The source code of Python is also object oriented.
Interpreted
Python is an interpreted language that supports byte compilation. Python programs
can be run, debugged, and tested interactively by the Python interpreter, which runs in
interactive mode. In traditional interpreted languages, execution does not take place in
the native binary language of a system. Therefore, execution in traditional interpreted
languages is slower compared to that of compiled languages. Python’s source code is
byte-compiled directly when it is loaded on the interpreter, or it can be explicitly byte-
compiled. In addition, byte code of Python is machine independent and can be exe-
cuted on different hardware and software platforms without compiling it again.
Therefore, Python is an intermediate form providing features of both compiled and
interpreted languages.
Let’s discuss in detail why Python is considered an interpreted language. Python
programs can be executed at the interpreter in command-line mode and script mode. In
command-line mode, you type Python statements, and the interpreter prints the result.
$ python
Python 2.2a4 (#2, Nov 2 2001, 11:00:25)
GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on Linux2
Type “help”,”copyright”, “credits” or “license” for more information.
>>> print 1 + 1
2
The first line of this example is the command that starts the Python interpreter. The
next two lines are messages that are displayed by the interpreter. The third line begins
with three greater-than signs (“>>>”), which is the prompt used by the interpreter to
indicate that it is ready. This is also the interpreter’s primary prompt. Typing 1 + 1 at
the interpreter returns 2 as the result in the next line.
If your code has a multiline construct, the interpreter prompts with a secondary
prompt, which is three dots (“...”) by default. Consider the following example:
>>> i=1
>>> if i is 1:
xiv Introduction
... print 1+1
2
Alternatively, you can write a program in a file and use the interpreter to execute the
contents of the file. Such a file written in Python is called a script. For example, a text
editor can be used to write a file, calculate.py, with the following contents:
print 1 + 1
By convention, files that contain Python programs have names with the .py extension.
To execute the program, you need to specify the name of the script at the interpreter.
$ python calculate.py
2
Extensible and Flexible
An application that contains a large amount of code can be effectively organized into
smaller modules due to Python’s dual structured and object-oriented programming
environments. These modules can still interact with each other or with other built-in
modules. Python’s syntax is the same for accessing both the user-defined and the built-
in standard modules. Python is also extremely flexible in the treatment of language
components. For example, a Python module that is meant to interact with the external
environment can be tested using an imitation of the external environment written in
Python.
Rich Core Library
Many development modules are built into Python and are part of the Python Standard
Library. A programmer can make use of these tools in the Python Standard Library,
depending on the application for which the tools are required. Besides modules that
work on all platforms, the library has modules that are specific to a particular platform
or environment. Python standard modules perform all types of usual tasks, such as
HTTP, FTP, POP, SMTP, and many other services. Using the rich core library, you can
write applications for downloading a Web page, parsing HTML files, developing a
graphic user interface (GUI), and so on.
Memory Management
C and C++ programmers always need to write code for handling memory manage-
ment and memory modification even if the program has very little to do with memory
access. This always results in an extra burden on the programmer. One clear example
is the need for tracking each object and deleting the reserved memory once the object
ends its life. This is the responsibility of the developer, and any failure can lead to
Introduction xv
memory leaks and other negative consequences. In Python, the interpreter manages
memory, thus removing the extra burden on the programmer. This results in fewer
errors and a more efficient application involving less development time.
Web Scripting Support and Data Handling
Python is popularly used for developing Internet and intranet applications. Python is
well suited for Internet and intranet applications because these applications are highly
dynamic and complex, and at times, they need to interact with several environments.
Python’s dynamism, the ease with which you can write complex applications, and its
advanced features, such as HTML, XML, and SGML parsing, allow you to write CGI
scripts for several environments.
Object Distribution
You can use Python to implement routines that can communicate with objects in other
languages. For example, Python can be used to pass data to COM components. In
addition, Common Object Request Broker Architecture (CORBA) can be implemented
in Python as well, which enables you to use cross-platform distributed objects.
Databases
Python provides interfaces to all major commercial databases. Besides that, it has built-
in modules that enable you to handle flat file databases. It also has object persistence
systems that can write entire objects to files. Python’s most important database-
programming feature, though, is Python API. This API includes functions that make it
easy to write applications that communicate with different databases.
GUI Programming
Python supports GUI applications that can be created and ported to many system calls,
libraries, and windows systems, such as Windows MFC, Macintosh, and the X Window
system of Unix. This is possible using Python’s default graphic user interface library,
Tkinter. Tkinter is the standard object-oriented interface of the TK GUI API, which is
the official GUI development platform of Python.
Extendable and Embeddable
You can add low-level modules to the Python interpreter. These modules enable pro-
grammers to add to or customize their tools to be more efficient. Compiled extension
modules can be created in Python to connect Python modules with external program-
ming libraries or new data types. Extension modules are easily created and maintained
using Python. Most platforms support the loading of new compiled components into
the interpreter dynamically. Python extension modules can be written in C and C++ for
CPython and in Java for JPython.
xvi Introduction
The Python interpreter can be embedded into another programming or scripting
application. Any other program can use the Python interpreter as a simple application
program interface (API). Therefore, the Python interpreter can act as a scripting tool
that glues everything.
Exception Handling
When running a program, if Python exits due to an error, it generates a complete stack
trace of errors. This stack trace indicates the name and type of the error that occurred.
The exception handling in Python allows you to detect errors at run time without adding
error-checking statements to your code. Exception handlers can be written in Python to
defuse a problem, perform a clean-up or maintenance action, or redirect the program
flow. This allows a programmer to put in considerably less effort to debug an error.
Portable
Python can run on a wide variety of hardware platforms and has the same interface on
all platforms. Its design is not linked to a particular operating system because it is writ-
ten in portable ANSI C. This means that you can write, test, and upload a program
written in Python on Windows, Linux, and Macintosh environments. This depends on
whether the application is developed to implement specific commands of an operating
system or if the application uses modules that do not work on all platforms. In these
situations, the application cannot run on all hardware platforms; however, this affects
only a few modules. Usually, the applications that you create run on all the platforms
without changing any code.
Freeware
Python is freeware and can be redistributed freely in the source form. The copyright of
Python does not allow authors to place it at risk legally and does prevent users from
hijacking its copyright. Programmers and users are allowed to use Python’s source in
any desired way. Programmers can create applications and release them in the binary-
only form, which has modules in only the byte-compiled form. The result of the prod-
uct can, however, be sold or distributed in any manner.
Users and Application Areas of Python
Python is an advanced scripting language that is being used in various areas. Some of
the areas where Python is being used are the following:
■
■ Gluing together large software components. These large software components
can be written in C, C++, or Java.
■
■ Creating prototypes of an application. The prototype can be written in Python
without writing any C, C++, or Java code. Often, the prototype is sufficiently
functional and performs well enough to be delivered as the final product, sav-
ing considerable development time.
Introduction xvii
■
■ Writing CGI scripts on all platforms (Unix, Windows, and Mac). Because of this
ability Python has a strong presence on the Web.
Besides these, Python is also well represented in the distributed systems world. It is
one of the main languages supported by Xerox PARC’s ILU. It has also been used to
implement the Web browser Grail.
A list of Python users worldwide include the following:
■
■ NASA
■
■ Infoseek
■
■ Digital Creations
■
■ Grail
■
■ Xerox
■
■ Hewlett-Packard
■
■ CMU
■
■ Digital Media Inc.
■
■ University of Queensland, Australia
■
■ Space Telescope Science Institute
■
■ Mind Spring
■
■ Mitretek Systems
Python versus Other Languages
It is a well-known fact that scripting languages are slower than compiled languages.
The Python interpreter carries out most of the tasks that are carried out by a compiler
in all compiled languages. at Python, however, is an intermediate language that pro-
vides the features of both compiled and interpreted languages. Python can be com-
pared with many other languages mainly because it provides many salient features in
other languages and is derived from many languages, such as C, C++, Modula-3, ABC,
SmallTalk, and Unix shell.
Python is often compared with C and C++ because it has syntax similar to the syn-
tax of these languages. Python is considered a good tool to test C and C++ applications.
It also glues some components of C/C++ contributing to C/C++ projects. In many
ways, Python has merits over C/C++. Memory allocation and reference errors that
occur in C/C++ are eliminated by the Python interpreter, which performs automatic
memory management. Python code is usually easier and smaller than that in C and
C++. Python’s array constructs generate fewer problems than the array constructs of
C and C++.
Perl is another scripting language that you can compare with Python. Like Python,
Perl is of great use to programmers and system administrators. Perl is also a powerful
language for text manipulation and data extraction. Unlike Python, though, Perl has a
difficult syntax that dissuades beginners from learning it. Perl is a popular language
xviii Introduction
used to develop Common Gateway Interface (CGI) scripts for Internet programming.
Programmers working on the same large project find it difficult to understand each
other’s code because there are many ways of writing a program.
Tcl is also one of the popular scripting languages. Python is compared with Tcl for
many reasons. Tcl is a powerful and easy scripting language that provides the features
of a programming language as well as tools for system calls. Tcl is a more restrictive
language than Python because it has fewer data types than Python. Python uses the
same toolkit, Tk, as Tcl for developing GUI applications.
Python uses the OOP concept and has syntax similar to that of Java. Unlike Python,
Java applications require huge code and a compilation phase. Moreover, Python offers
dynamic typing and a rapid development environment. Python, though, is slower and
less portable than Java. A breakthrough in the relationship of Python and Java is
JPython, a Python interpreter that is constructed completely in Java. It can run on any
machine containing Java Virtual Machine (JVM). It provides programmers with the
features of Python along with a hoard of Java classes. A complete discussion on
JPython is out of the scope of this book. Some of its salient features are as follows:
■
■ JPython provides a scripting environment for Java development.
■
■ JPython generates a truly object-oriented programming environment.
■
■ An application written in JPython can access Java classes directly and can inte-
grate them with its own JPython classes, whenever required.
■
■ JPython provides access to Java AWT/Swing libraries for GUI development.
■
■ Compiled JPython programs create Java byte code, creating a .class file,
which can be used to create applets.
How This Book Is Organized
This book shrugs away from the traditional content-based approach and uses the
problem-based approach to present the concepts of Python. Problems used in the book
are presented against the backdrop of real-life scenarios. The problem is followed by a
task list that helps to solve that problem, in the process delivering the concepts and
their implementation. This practical approach will help readers to understand the real-
life application of the language and its use in various scenarios. Moreover, to provide
an appropriate learning experience, the concepts will be supported adequately by case
studies that will be formulated in such a way that they provide a frame of reference for
the reader.
Chapter 1 is a guide to obtaining the Python software and its documentation. It also
discusses installation of Python on Unix, Linux, and Windows systems. Finally. it dis-
cusses the execution modes of Python and starting Python in Unix, Linux, and Windows.
Chapter 2 is a getting-started guide. It leads into developing a simple Python
program. Then, it discusses the standard data types, type operators, and expressions.
Finally, it mentions the identifiers and keywords in Python.
Introduction xix
Chapter 3 introduces intrinsic operations and input/output. It discusses formatting
the output to enhance its visual appeal. It further discusses the built-in functions to use
with each data type.
Chapter 4 introduces programming constructs. It discusses using conditional
constructs if...else, elif, and nested if constructs. It moves on to discuss loop
constructs while and for. Finally, it discusses break, continue, and pass state-
ments, which are used in loop constructs.
Chapter 5 moves a step further and discusses about functions. It also discusses user-
defined functions, Then, it talks about passing functions as arguments and returning
values from functions. Finally, it discusses the built-in functions apply(), filter(),
and map().
Chapter 6 discusses organizing code in Python modules. It also delves into importing
data from modules into the programming environment. Finally, it discusses organizing
modules into packages.
Chapter 7 introduces using files in Python. It discusses writing and appending data
to a file. It also discusses how to use Python to read the contents of a file.
Chapter 8 delves into the all-important concept of object-oriented programming. It
discusses classes and class objects in Python. Then, it discusses implementing classes.
Finally, it talks about using inheritance, overriding methods, and using wrapping.
Chapter 9 explains exceptions and the phases in which the actions related to an
exception are performed. Next, it mentions the standard exceptions in Python. It fur-
ther explains how exceptions can be raised. Finally, the chapter closes by explaining
user-defined exceptions.
Chapter 10 moves a few steps further and introduces CGI programming. This chapter
assumes that the reader has understands basic Internet concepts and knows how to create
Web pages and forms using HTML. For those who are new to the Internet, the chapter
briefly recaps World Wide Web, HTTP requests, and HTML form elements and tags. The
chapter then differentiates between client-side and server-side scripting. It finally dis-
cusses the cgi module and generating dynamic Web pages by using a CGI application.
Chapter 11 assumes the reader has basic knowledge about databases, data storage in
databases, RDBMS concepts, and their implementation in MySQL. For those who are
new to MySQL, this chapter details concepts about installing MySQL and working
with the databases and tables in MySQL. It also discusses the Python Database API.
Next, the chapter explains the processes of accessing and manipulating a MySQL data-
base by using Python commands. Finally, the chapter discusses concepts such as the
creation of a database table to store information and the use of query statements to
access and manipulate data.
Chapter 12 delves into network programming in Python by using sockets. It dis-
cusses client/server architecture, protocols, sockets, IP addresses, and ports. It then dis-
cusses using the socket to create a TCP server, TCP client, UDP server, and UDP client.
Chapter 13 introduces another extremely important concept of multithreaded pro-
gramming. The chapter begins by differentiating between a single-threaded application
and a multithreaded application. It then discusses the thread module to create threads.
Finally it discusses the threading module to create multithreaded applications.
Chapter 14 further discusses advanced Web programming concepts. To start with,
this chapter discusses how to create a Web server. Next, it talks about how to work
xx Introduction
with URLs by using Python. Finally, this chapter explains advanced CGI to generate
dynamic Web pages using cookies and uploading files across an HTTP connection.
Chapter 15 delves into developing user-friendly graphic interfaces. This chapter
discusses using Tkinter, the official GUI framework for Python, to create GUI applica-
tions. It mentions the various controls that can be included in a GUI interface. Finally,
it leads to designing a GUI application.
Finally, the appendix gives a brief introduction to Component Object Model (COM).
It mentions the basics of COM and the support for COM in Python.
Who Should Read This Book
This book will be a guide for readers with a basic knowledge of programming. For those
with an intermediate knowledge of Python, the book covers the advanced concepts of
Python, too. This book will be of great help to people with the following job titles:
■
■ Software engineers
■
■ Web application developers
■
■ Information application developers
The book will provide the necessary skills to create GUI, networking, and Web
applications. It will also talk about extending and embedding Python applications.
Tools You Will Need
For performing the tasks in this book, you will need a Pentium 200 MHz computer
with a minimum of 64MB RAM (128MB RAM recommended).
You will also need the following software:
■
■ Operating system: Linux 7.1 or Windows 2000 Server
■
■ Web server: Apache 1.3.19-5 (on Linux) and IIS 5.0 (on Windows)
■
■ Relational database management system (RDBMS): MySQL 3.23.36-1
■
■ GNU C++ for Windows 2000
■
■ Python 2.2
What’s on the Web Site
The following will be available on the site www.wiley.com/compbooks/makinguse:
■
■ Python 2.2
■
■ All the code snippets used in the book
Introduction xxi
Making use of Python 1st Edition Rashi Gupta
All problem statements in this book are based on the scenario of the Techsity University.
The following section elaborates on the setup of Techsity University and the univer-
sity’s future plans.
Techsity University
The term instructor-led training (ILT) implies that the real strength of the training
depends on the instructor and the type of concept insight, knowledge, flexibility, and
leadership an instructor can provide through the training. ILT is a form of traditional
classroom learning methodology where students can ask questions, seek clarifications,
and work directly in coordination with a knowledgeable instructor so as to fully under-
stand concepts and terminology. This was the idea that led to the inception of Techsity
University in January 1999.
Techsity University started its operations with 50 students and 4 trainers at its center
located in New York City. A total commitment to quality in terms of student satisfaction
enabled Techsity University to earn a profit of $1 million in the very first year of its oper-
ation. As an outcome of student responses to the courses offered, student enrollment
and staff recruitment in Techsity University increased over the past three years.
Currently, Techsity University provides 50 instructor-led courses, which include soft
skills development courses and technical courses. Currently, the university offers these
courses in five cities in different states of the United States; however, only four courses
are available at any given time. At present, Techsity University offers regular as well as
part-time courses.
Scenario
xxiii
The five cities in which the Techsity University has centers are these:
■
■ New York
■
■ Los Angeles
■
■ Chicago
■
■ Denver
■
■ Washington, D.C.
The courses offered by Techsity University can be classified in the following
categories:
■
■ Business development
■
■ Professional development
■
■ Information technology
■
■ Software
■
■ Desktop technologies
Course Structure
Usually, the duration of the courses offered by the Techsity University varies from
three to four weeks. Details about each course, such as fees, the syllabus, and the class
structure, are available at the front office of each University location. Typically, a course
comprises a beginner, an intermediate, and an advanced level. A student may choose
to start from any of the three levels. If a student chooses to start a course from the inter-
mediate or advanced levels, the student is interviewed at the beginning of the course.
In addition, the student needs to take an entry-level test so that the authorities can
determine whether the student meets the course prerequisites. Therefore, a student can
join a course a level or two above the beginner’s level only after clearing the test and
the interview.
The schedule of regular courses consists of a five-hour class from Monday to Friday.
Not all courses are offered as part time. The part-time courses have five-hour classes on
weekends and two-hour classes on two chosen days of the week.
Course objectives, syllabi, and any preliminary reading assignments are given to stu-
dents before the start of the course. Depending on the type of course, the course structure
comprises theoretical classes and hands-on practice classes. To increase the effectiveness
of courses, a class may also contain an amalgamation of both theory and practice.
Fee Structure
The University has a flexible and moderate fee structure for the convenience of its stu-
dents. A student can choose to pay the entire fee at the time of enrollment or pay the fee
amount in installments. When paying in installments, a student has to pay 50 percent
of the fees as down payment, 25 percent after the completion of 25 percent of the
course, and the remaining 25 percent after completion of 75 percent the course.
xxiv Scenario
Future Direction
As the number of students approaching the University for enrollment is increasing, it
is considering offering its courses on the Web as well. The main reasons for such a con-
sideration are as follows:
■
■ Accommodating ILT in a student’s schedule means rearranging the student’s
life around training rather than arranging training around the student’s life.
■
■ Because ILT relies so severely on the instructors, a bad instructor can negate all
the advantages associated with ILT.
■
■ For the employed, attending ILT means time away from the office and involves
additional costs for travel, lodging, meals and so forth.
■
■ ILT is conducted at a speed dictated by the training material, the time allotted
to the class, and the instructor’s approach to the training material. Students
who do not fit the knowledge base or the understanding of the intended target
audience in the class may find an ILT class a frustrating experience. A good
instructor will tune the presentation to make it applicable to the widest range
of classroom audience.
Keeping these points in mind, Techsity University plans to gradually launch its con-
tent on the Web. The Techsity University Web site planned to be developed soon will
not only offer its Web-based courses but also promote instructor-led training, which
forms the backbone of the courses it offers. The Web site will also provide support to
students, such as providing experts to answer students’ queries and accepting and
evaluating student assignments online.
Scenario xxv
Making use of Python 1st Edition Rashi Gupta
C HAPTE R
1
C HAPTE R
OBJECTIVES:
In this chapter, you will learn to do the following:
 Identify the scenarios where Python can be used
 Obtain Python and its documentation
 Examine system requirements
 Install Python
 Start Python in different execution modes
Getting Started
The Introduction familiarized you with Python. It discussed what Python is, its history,
and its key features. This chapter will discuss the locations from where Python can be
obtained. You will also learn how to install Python on the various platforms and the
various ways in which a Python program can be executed. At the end, you will learn
about the Web sites from which Python documentation can be obtained.
An Introduction to Python
C HAPTE R
1
Understanding Requirements
Problem Statement
Techsity University has been set up recently and currently does not have an online site.
The University plans to expand its activities in the field of online training courses so
that students from all over the United States can enroll for courses. Techsity wants a
Web site that will enable learners to obtain information about its courses at the touch
of a key. The Web site should be fast to code, scalable, and robust.
Techsity has an application for internal use that was developed using C and C++. It
wants to reuse as much of this application as possible to reduce development time for
the new application. The new application needs to be developed within three months
by using the existing team of C and C++ developers.
Techsity’s Chief Technology Officer (CTO) has recommended Python as the new
language because it meets all the requirements of the new application and because the
existing team will be able to learn the new language easily, thus reducing the learning
and development time. The CTO has assigned the task of understanding system
requirements, obtaining Python for the development team, and getting Python run-
ning to Jim.
Task List
 Determine requirements of the University.
 Download Python and its documentation.
 Determine the system requirements.
 Install Python.
 Start Python in different execution modes.
Determine Requirements of the University
Before deciding on the software application and hardware platforms to use for the pre-
vious scenario, let’s understand the requirements of the University (see Table 1.1).
Obtain Python and Its Documentation
Python is currently available in five stable versions. Python 1.5.2 was released in April
1999. Python 1.6 was made available to the public in September 2000 and has major
new features and enhancements over Python 1.5.2. Python 2.0, released in October
2000, was more of a transition from Python 1.6. Python 2.1.1, released in July 2001, was
mainly a bug fix release for Python 2.1. The final release of the latest version, Python 2.2,
was released in December 2001. This book was developed when Python 2.2 was in its
alpha release 4. Therefore, most of the screen shots in this book are taken in Python 2.2a4.
2 Chapter 1
Table 1.1 Requirements of Techsity University
REQUIREMENT DESCRIPTION
Development time The entire application needs to be developed in three
months.
Platform The customers and dealers should be able to use any
kind of operating system platform; that is, the
application should be platform independent.
Speed Techsity wants a computerized system that enables
learners and dealers to obtain information about its
products and schemes readily.
Accessibility The University wants an information system that will
enable individuals from any part of the United States to
receive help on the courses and schemes offered by
Techsity.
Association The system should allow extension and embedding of
C and C++ to make use of existing applications in these
languages.
Other features The CTO wants the application to be powerful, robust,
and scalable.
How to decide on the version? The code written in Python 1.5.2 is backward
compatible with older versions and is available on the largest number of platforms.
Python 2.0 has new features, such as Unicode support, but does not support backward
compatibility. Programmers who are migrating from Python 1.5.2 to 2.0 can use Python
1.6. Programmers looking for improved features, such as Python’s model of objects
and classes, improved multiple inheritance, new iteration interface, and new and
improved modules, should use Python 2.2.
You can find all the latest information about Python on the Python official Web site
or the Pythonlabs Web site. The links are as follows:
http://www.python.org (Community home page)
http://www.pythonlabs.com (Commercial home page)
Python is freeware; therefore, all of Python’s current software versions are available
for free on the sites listed previously. You can download the Python distribution for
Unix, Windows, and Mac systems from the link www.python.org/download. In addi-
tion, Python documentation, news, and more are also available on this site. You can
download the Python documentation from www.python.org/doc/. The documenta-
tion is available in HTML, PDF, and PostScript formats. A part of the documentation is
An Introduction to Python 3
also available with the software package. The Python 2.2 distribution is a part of the
following documentation that helps you learn Python and its advanced features:
■
■ The Python Tutorial
■
■ Global Module Index
■
■ Library Reference
■
■ Macintosh Module Reference
■
■ Installing Python Modules
■
■ Language Reference
■
■ Extending and Embedding
■
■ Python/C API
■
■ Documenting Python
■
■ Distributing Python Modules
NOTE If you do not have Internet connectivity, all the versions of Python are
available on the Web site for this book, www.wiley.com/compbooks/gupta.
Determine the System Requirements
As discussed earlier, Python is available on a wide variety of platforms, such as Unix,
Windows, Macintosh, X Windows, OS/2, Be-OS, VMS, and Amiga. Python is supported
by most of the platforms that have a C compiler. After you download your version of
Python, which is in compressed format, you need to unpack the downloaded files. If
you are using Unix, the GNA gzip program performs the required action. The GNA
gzip program is available at www.gnu.org/software/gzip/gzip.html. For Windows, it
is necessary to have the WinZip program to unpack the downloaded files. Winzip can
be downloaded from www.winzip.com. To run Python, the system requirements are as
shown in Table 1.2.
You can choose from a host of software platforms to run Python. For the develop-
ment of this book, the software configuration shown in Table 1.3 is used.
Table 1.2 Hardware Specifications for Using Python
HARDWARE SPECIFICATION
Processor Pentium, 200 MHz
RAM 64 MB, 128 MB (Recommended)
4 Chapter 1
Table 1.3 Software Specifications for Using Python
SOFTWARE SPECIFICATION
Operating system Linux 7.1, Windows 2000 Server, and Windows NT Server
Web server Apache 1.3.19-5, (IIS 5.0 for Windows)
RDBMS My SQL 3.23.36-1
Web browser Netscape 4.76
GNU C++ For Windows NT/2000
Python Version 2.2a4
Install Python
As mentioned earlier, Python distribution is available for a wide variety of platforms.
You need to download only the binary code applicable for your platform and install
Python. If the binary code for your platform is not available, you need a C compiler to
compile the source code manually. Compiling the source code offers more flexibility in
terms of choice of features that you require in your installation. For example, for Win-
dows, you might want to install the additional Tcl/Tk support feature on which you
can build your GUI applications or install Win32 extensions, COM extensions, and
more. Similarly, you can choose to install Tkinter or the GNU readline module, which
allows you to scroll back through Python commands in the interpreter. All this can be
incorporated in the Unix installation of Python by editing the Setup file in the Modules
subdirectory in the source distribution.
Unix Installation
After unpacking the files in the source distribution and converting them into a tar
archive, you can install Python. This requires running the ./configure script in the
Python archive. Then, type make at the shell prompt, and type make install. On
Unix machines, the Python executable is usually installed in the /usr/local/bin
directory, and its libraries are installed in /usr/local/lib/pythonXX where XX is
the version of Python that you are using.
Linux Installation
Almost all major Linux distributions include Python. You might want to install the
latest version of Python, though, even if Python is installed automatically for you. This
can be done by using the RPM (RedHat Packet Manager) package for installation. The
An Introduction to Python 5
RPMs for Linux installation can be downloaded from www.python.org/2.2/rpms.html.
You must execute the following command to update the RPM:
rpm -Uhv python2.2-2.2b1-2.i386.rpm
Or use the following command to install the RPM from the RPM package:
rpm -ihv python2.2-2.2b1-2.i386.rpm
(Note that the preceding filenames reflect the beta version of Python 2.2.) For a fresh
installation of Python from the source code on a Linux machine, follow the same steps
as for Unix installation. You can also download the source RPM and build a binary
package by using the following command:
rpm —rebuild python2.2-2.2b1-2.src.rpm
Windows Installation
On Windows, you can install Python by running Python-XXX.exe, where XXX is
Python’s latest release. On Windows, double-clicking the file will launch the Installation
Wizard, as shown in Figure 1.1.
After installing Python, if you want to install PythonWin and PythonCOM software
also, double-click the win32all-YYY.exe file. Each version of Python has a specific
corresponding win32all file. Therefore, do not install the file that is intended for a
different release. You can download this file for the specific version of Python from the
following location: http://aspn.activestate.com/ASPN/Downloads/ActivePython/
Extensions/Win32all.
Figure 1.1 Python Installation Wizard guides you through a simple installation process.
6 Chapter 1
Start Python in Different Execution Modes
You can start Python in three different ways. One way is to start the interpreter inter-
actively where each line that you enter is executed at the same time. The second way is
to run a script written in Python. In this case, the interpreter directly executes the
script. Finally, you can run the interpreter in the form of a GUI that is part of the Inte-
grated Development Environment (IDE). An IDE usually provides tools for debugging
and editing text.
Interactive Interpreter
You can start Python in the command-line interpreter mode and start writing code.
Any operating system that provides you with a command-line interpreter or a shell
window, such as DOS or Unix, can start Python in an interactive interpreter mode. This
mode can be extremely helpful when you want to test the specific features of Python.
Unix. To start the Python interpreter, you need to type the full path to the Python
executable if you have not added the directory containing the Python executable
to your search path. Python usually exists in /usr/bin or /usr/local/bin
directories. To add Python to the search path, you can add the full path of the
directory containing the Python executable to the set path or PATH= directive.
After this, refresh the shell’s path variable. Now, you can invoke the Python
interpreter by typing python at the shell prompt.
$python
Typing python at the shell prompt will start the Python interpreter in the Unix
environment and will show the Python primary prompt denoted by “” as
shown in Figure 1.2.
Figure 1.2 Starting Python in a Unix window.
An Introduction to Python 7
Figure 1.3 Starting Python in the Windows command line.
Windows. In order to run Python directly by typing python at the command
prompt, add Python to your search path. This is similar to what is done in Unix.
You can do this by editing the C:Autoexec.bat file. The Python executable
in Windows is usually installed in C:Program FilesPython or
C:Python. In Windows also, you can start Python by typing python at the
command prompt C:. This will start the Python interpreter in Windows, as
shown in Figure 1.3.
Script from the Command Line
You can also request Python to directly execute a script from the command-line inter-
face. This is the same for Windows, Unix, or any other operating system that supports
command-line interface, as in the following commands:
C:python myscript.py
$ python myscript.py
These commands, for Windows and Unix, execute the script myscript.py from
the current directory. If the script you want to execute is not in the current directory,
specify the complete path for the script.
You can also invoke the Python interpreter automatically without explicitly invok-
ing it from the command line. Include the following line to launch shell as the first line
of your script:
#!/usr/local/bin/python
The path following #! is the full path of the location of the Python interpreter. Be
careful to give the correct path name; if the path name is not correct, the shell will
return an error message.
8 Chapter 1
When you have added a startup directive to the beginning of your script, the Python
interpreter does not need to be explicitly invoked. You can run the script directly using:
$myscript.py
Alternatively, you can use a command named env for the startup directive, which is
installed in either /bin or /usr/bin. This command finds the Python interpreter in
your path. You can use env when you do not know where the Python executable is
located. You can also use env if you change its position frequently, but it is still avail-
able through the directory path you specify.
In Windows, if you have a Python IDE installed (this will be discussed in the next
section), you can execute a script directly by double-clicking it.
Integrated Development Environment
Python can also be started from a graphical user interface (GUI) environment. This can
be done using a GUI application, such as Tcl/Tk. Most GUI applications are IDEs as
well. IDEs provide the additional features of editing, tracing errors, and debugging.
Unix. IDLE is the first Unix IDE for Python. IDLE is Tkinter based and requires
Tcl/Tk to be installed on your system. You do not need to install Tcl/Tk fully
because the current versions of Python include the minimal subset of the Tcl/Tk
library in the distribution.
The IDLE executable is located in the Tools subdirectory with the source distrib-
ution. IDLE can be invoked by typing idle at the shell prompt. Figure 1.4 shows
the IDLE window in Unix.
Figure 1.4 Starting IDLE in Unix.
An Introduction to Python 9
Figure 1.5 The PythonWin environment in Windows.
Windows. PythonWin is the first Windows IDE for Python. The PythonWin
distribution includes Win32 API extensions, COM extensions, and Tcl/Tk.
PythonWin can be invoked by executing the file pythonwin.exe, which is
usually located in the same directory as Python in the Pythonwin subdirectory
C:Program FilesPythonPythonwin. Among its main features are a
color text editor, a debugger, an interactive shell window, and more. Figure 1.5
shows the PythonWin environment running in Windows, including the main
PythonWin window and a script open in its integrated source code editor.
As mentioned earlier, PythonWin can be installed by running the executable file
win32all-YYY.exe specific for the version of Python that you have on your
computer. You can obtain more information on PythonWin from the Pythonwin
readme file, which is located at C:Program FilesPythonPythonwin
readme.html or any other location where PythonWin is installed.
Besides PythonWin, IDLE can also be installed on the Windows platform. It is
in the Tools or Idle subdirectory of the folder where Python is installed. To
start IDLE, double-click the idle.pyw executable. Figure 1.6 shows the IDLE
window in Windows.
10 Chapter 1
Figure 1.6 The IDLE environment in Windows.
Macintosh. The Python version that runs on Macintosh is called MacPython. It is
also available on www.python.org and can be downloaded as MacBinary or
BinHex’d files. Python source code is also available on the main Web site as
a Stuff-It archive, and the full version is available as a unique file, which also
includes Tkinter and IDLE. As in Unix and Windows, IDLE also works on
Macintosh. Figure 1.7 shows the IDLE environment in Macintosh.
Figure 1.7 The IDLE environment in Macintosh.
An Introduction to Python 11
Summary
In this chapter, you learned the following:
■
■ Python is currently available in five stable versions: 1.5.2, 1.6, 2.0, 2.1.1, and 2.2.
The final release of the latest version Python 2.2 was made available in Decem-
ber 2001.
■
■ You can find all the latest information about Python on the Python official Web
site or the Pythonlabs Web site. The links, respectively, are:
http://www.python.org (Community home page)
http://www.pythonlabs.com (Commercial home page)
■
■ Python runs on a wide variety of platforms, such as Unix, Windows, Macintosh,
X Windows, OS/2, Be-OS, VMS, and Amiga, to name a few.
■
■ You can download the Python distribution for Unix, Windows, and Mac systems
from the link www.python.org/download. In addition, the Python documenta-
tion, news, and other articles are also available on this site. You can download
the Python documentation from www.python.org/doc/. This documentation
is available in HTML, PDF, and PostScript formats.
■
■ To install Python, download the binary applicable for your platform and execute
it in the way applicable for your platform.
■
■ Python can be started in three different ways:
■
■ As the interactive interpreter
■
■ Directly executing a script from the command line
■
■ As an Integrated Development Environment (IDE)
12 Chapter 1
13
OBJECTIVES:
In this chapter, you will learn to do the following:
 Write your first Python program
 Use comments
 Use Python as a calculator
 Use variables
 Use standard data types:
 Number
 String
 List
 Tuple
 Dictionary
 Examine memory management in Python
Getting Started with Python
C HAPTE R
2
C HAPTE R
Discovering Diverse Content Through
Random Scribd Documents
Parmelia saxatilis during a period of eight years: the yearly increase of the thallus was half a
centimetre, so that specimens of twenty centimetres in breadth must have been growing from
forty to fifty years.
Bitter’s[903] observations on Parmelia physodes agree in the main with those of Vallot: the
increase of the upper lobes during the year was 3-4 mm. In a more favourable climate Heere
found that Parmelia caperata (Fig. 49) on a trunk of Aesculus in California had grown
longitudinally 1·5 cm. and transversely 1 cm. The measurements extended over a period of
seven winter months, five of them being wet and therefore the most favourable season of
growth. In warm regions lichens attain a much greater size than in temperate or northern
countries, and growth must be more rapid.
A series of measurements was also made by Heere[904] on Ramalina reticulata (Fig. 64), a
rapid growing tree-lichen, and one of the largest American species. The shorter lobes were
selected for observation, and were tested during a period of seven months from September to
May, five of the months being in the wet season. There was great variation between the
different lobes but the average increase during that period was 41 per cent.
Krabbe[905] took notes of the colonization of Cladonia rangiferina (Fig. 127) on burnt soil: in
ten years the podetia had reached a height of 3 to 5 cm., giving an annual growth of about 3-5
mm. It is not unusual to find specimens in northern latitudes 18 inches long (50 cm.), which,
on that computation, must have been 100 to 160 years old; but while increase goes on at the
apex of the podetia, there is constant perishing at the base of at least as much as half the
added length and these plants would therefore be 200 or 300 years old. Reinke[906] indeed has
declared that apical growth in these Cladina species may go on for centuries, given the
necessary conditions of good light and undisturbed habitat.
Other data as to rate of growth are furnished by Bonnier[907] in the account of his synthetic
cultures which developed apothecia only after two to three years. The culture experiments of
Darbishire[908] and Tobler[909] with Cladonia soredia are also instructive, the former with
synthetic spore- and alga-cultures having obtained a growth of soredia in about seven months;
the latter, starting with soredia, had a growth of well-formed squamules in nine months.
It has been frequently observed that abundance of moisture facilitates growth, and this is
nowhere better exemplified than in crustaceous soil-lichens. Meyer found that on lime-clay soil
which had been thrown up from a ditch in autumn, lichens such as Gyalecta geoica were fully
developed the following summer. He gives an account also of another soil species, Verrucaria
(Thrombium) epigaea, which attained maturity during the winter half of the year. Stahl[910]
tells us that Thelidium minutulum, a pyrenocarpous soil-lichen, with a primitive and scanty
thallus, was cultivated by him from spore to spore in the space of three months. Such lichens
retain more of the characteristics of fungi than do those with a better developed thallus. Rapid
colonization by a soil-lichen was also observed in Epping Forest by Paulson[911]. In autumn an
extensive growth of Lecidea uliginosa covered as if with a dark stain patches of soil that had
been worn bare during the previous spring. The lichen had reached full development and was
well fruited.
These facts are quite in harmony with other observations on growth made on Epping Forest
lichens. The writers[912] of the report record the finding of “fruiting lichens overspreading
decaying leaves which can scarcely have lain on the ground more than two or three years;
others growing on old boots or on dung and fruiting freely; others overspreading growing
mosses.” They also cite a definite instance of a mass of concrete laid down in 1903 round a
surface-water drain which in 1910—seven years later—was covered with Lecanora galactina in
abundant fruit; and of another case of a Portland stone garden-ornament, new in 1904, and, in
1910, covered with patches of a fruiting Verrucaria (probably V. nigrescens). Both these
species, they add, have a scanty thallus and generally fruit very freely.
A series of observations referring to growth and “ecesis” or the spreading of lichens have
been made by Bruce Fink[913] over a period of eight years. His aim was mainly to determine
the time required for a lichen to re-establish itself on areas from which it had been previously
removed. Thus a quadrat of limestone was scraped bare of moss and of Leptogium lacerum,
except for bits of the moss and particles of the lichen which adhered to the rock, especially in
depressions of the surface. After four years, the moss was colonizing many small areas on
which grew patches of the lichen 2 to 10 mm. across. Very little change occurred during the
next four years.
Numerous results are also recorded as to the rate of growth, the average being 1 cm. per
year or somewhat under. The greatest rate seems to have been recorded for a plant of
Peltigera canina growing on “a mossy rock along a brook in a low moist wood, well-shaded.” A
plant, measuring 10 by 14 cm., was deprived of several large apothecia. The lobes all pointed
in the same direction, and the plant increased 1·75 cm. in one year. Two other plants, deprived
of their lobes, regenerated and increased from 2 and 5 cm. respectively to 3·5 and 6 cm. No
other measurements are quite so high as these, though a plant of Parmelia caperata (sterile),
measuring from 1 to 2 cm. across, reached in eight years a dimension of 10 by 13 cm. Other
plants of the same species gave much slower rates of increase. A section of railing was marked
bearing minute scattered squamules of Cladonia pityrea. After two years the squamules had
attained normal size and podetia were formed 2 to 4 mm. long.
Several areas of Verrucaria muralis were marked and after ten months were again measured;
the largest plants, measuring 2·12 by 2·4 cm. across, had somewhat altered in dimensions and
gave the measurements 2·2 by 3 cm. Some crustose species became established and produced
thalli and apothecia in two to eight years. Foliose lichens increased in diameter from 0·3 to 3·5
cm. per year. So far as external appearance goes, apothecia are produced in one to eight
years; it is concluded that they require four to eight years to attain maturity in their natural
habitats.
B. Season of Fruit Formation
The presence of apothecia (or perithecia) in lichens does not always imply the presence of
spores. In many instances they are barren, the spores having been scattered or not yet
matured; the disc in these cases is composed of paraphyses only, with possible traces of asci.
In any month of the year, however, some lichens may be found in fruit.
Baur[914] found, for instance, that Parmelia acetabulum developed carpogonia the whole
year round, though somewhat more abundantly in spring and autumn. Pertusaria communis
similarly has a maximum period of fruit-formation at these two seasons. This is probably true of
tree-lichens generally: in summer the shade of the foliage would inhibit the formation of fruits,
as would the extreme cold of winter; but were these conditions relaxed spore-bearing fruits
might be expected at any season though perhaps not continuously on the same specimen.
An exception has been noted by Baur in Pyrenula nitida, a crustaceous tree Pyrenolichen. He
found carpogonia only in February and April, and the perithecia matured in a few weeks,
presumably at a date before the trees were in full leaf; but even specimens of Pyrenula are not
unusual in full spore-bearing conditions in the autumn of the year.
To arrive at any true knowledge as to the date and duration of spore production, it would be
necessary to keep under observation a series of one species, examining them microscopically
at intervals of a few weeks or months and noting any conditions that might affect favourably or
unfavourably the reproductive organs. A comparison between corticolous and saxicolous
species would also be of great interest to determine the influence of the substratum as well as
of light and shade. But in any case it is profitable to collect and examine lichens at all seasons
of the year, as even when the bulk of the spores is shed, there may remain belated apothecia
with a few asci still intact.
C. Dispersal and Increase
The natural increase of lichen plants may primarily be sought for in the dispersal of the
spores produced in the fruiting-bodies. These are ejected, as in fungi, by the pressure of the
paraphyses on the mature ascus. The spores are then carried away by wind, water, insects, etc.
In a few lichens gonidia are enclosed in the hymenium and are ejected along with the spores,
but, in most, the necessary encounter with the alga is as fortuitous, and generally as certain,
as the pollination of anemophilous flowers. A case of dispersal in Sagedia microspora has been
described by Miyoshi[915] in which entire fruits, small round perithecia, were dislodged and
carried away by the wind. The addition of water caused them to swell enormously and brought
about the ejection of the spores. Areas covered by the thallus are also being continually
enlarged by the spreading growth of the hypothallus.
a. Dispersal of Crustaceous Lichens. These lichens are distributed fairly equally on trees or
wood (corticolous) and on rocks (saxicolous). Some species inhabit both substrata. As regards
corticolous lichens that live on smooth bark such as hazel or mountain-ash, the vegetative body
or thallus is generally embedded beneath the epidermis of the host. Soredia are absent and the
thallus is protected from dispersal. In these lichens there is rather an abundant and constant
formation of apothecia or perithecia.
Other species that affect rugged bark and are more superficial are less dependent on spore
production. The thallus is either loosely granular, or is broken up into areolae. The areolae are
each a centre of growth, and with an accession of moisture they swell up and exert pressure
on each other. Parts of the thallus thus become loosened and are dislodged and carried away.
If anchored on a suitable substratum they grow again to a complete lichen plant. Sorediate
lichens are dependent almost wholly on these bud-like portions for increase in number; soredia
are easily separated from the parent plant, and easily scattered. Darbishire[916] noted
frequently that small Poduridae in moving over the surface of Pertusaria amara became
powdered with soredia and very evidently took a considerable part in the dissemination of the
species.
Crustaceous rock lichens are rarely sorediate, but they secure vegetative propagation[917] by
the dispersal of small portions of the thallus. The thalli most securely attached are cracked into
small areolae which, by unequal growth, become very soon lop-sided, or, by intercalary
increase, form little warts and excrescences on their surface. These irregularities of
development give rise to more or less tension which induces a loosening of the thallus from the
substratum. Weather changes act similarly and gradually the areolae are broken off. Loosening
influence is also exercised by the developing fruits, the expanding growth of which pushes
aside the neighbouring tissues. Wind or water then carries away the thalline particles which
become new centres of growth if a suitable substratum is reached.
b. Dispersal of Foliose Lichens. It is a matter of common observation that, in foliose lichens
where fruits are abundant, there are few or no soredia and vice versa. In either case
propagation is ensured. In addition to these obvious methods of increase many lichens form
isidia, outgrowths from the thallus which are easily detached. Bitter[918] considers for instance
that the coralloid branchlets, which occur in compact tufts on the thallus of Umbilicaria
pustulata, are of immense service as organs of propagation. Apothecia and pycnidia are rarely
present in that species, and the plant thus falls back on vegetative production. Slender crisp
thalline outgrowths, easily separable, occur also on the edges of lobes, as in species of
Peltigera, Platysma, etc.
Owing to the gelatinous character of lichen hyphae, the thallus quickly becomes soft with
moisture and is then easily torn and distributed by wind, animals, etc. The action of lichens on
rocks has been shown to be of a constantly disintegrating character, and the destruction of the
supporting rock finally entails the scattering of the plant. This cause of dispersal is common to
both crustaceous and foliose species. The older central parts of a lichen may thus have
disappeared while the areolae on lobes of the circumference are still intact and in full vigour.
As in crustaceous lichens the increase in the area of growth may take place by means of the
lichen mycelium which, originating from the rhizinae in contact with the substratum, spreads as
a hypothallus under the shelter of the lobes and far beyond them. When algae are encountered
a new lobe begins to form. The process can be seen perhaps most favourably in lichens on
decaying wood which harbours moisture and thus enables the wandering hyphae to retain life.
c. Dispersal of Fruticose Lichens. Many of these lichens are abundantly fruited; in others soralia
are as constantly developed. Species of Usnea, Alectoria, Ramalina and many Cladoniae are
mainly propagated by soredia. They are all peculiarly liable to be broken and portions of the
thallus scattered by the combined action of wind and rain.
Peirce[919] found that Ramalina reticulata (Fig. 65), of which the fronds are an open
network, was mainly distributed by the tearing of the lichen in high wind. This takes place
during the winter rains, when not only the lichen is wet and soft in texture, but when the
deciduous trees are bare of leaves, at a season, therefore, when the drifting thalline scraps can
again catch on to branch or stem. A series of observations on the dispersal of forms of long
pendulous Usneas was made by Schrenk[920]. In the Middle and North Atlantic States of
America these filamentous species rarely bear apothecia. The high winds break and disperse
them when they are in a wet condition. They generally grow on Spruces and Firs, because the
drifting filaments are more easily caught and entangled on short needles. The successive
wetting and drying causes them to coil and uncoil, resulting in a tangle impossible to unravel,
which holds them securely anchored to the support.
D. Erratic Lichens
In certain lichens, there is a tendency for the thallus to develop excrescences of nodular form
which easily become free and drift about in the wind while still living and growing. They are
carried sometimes very long distances, and fall in thick deposits over localities far from their
place of origin. The most famous instance is the “manna lichen,” Lecanora esculenta, which has
been scientifically examined and described by Elenkin[921]. He distinguishes seven different
forms of the species: f. esculenta, f. affinis, f. alpina, and f. fruticulosa-foliacea which are Alpine
lichens, the remainder, f. desertoides, f. foliacea and f. esculenta-tarquina, grow on the steppes
or in the desert[922].
Elenkin[921] adds to the list of erratic lichens a variety of Parmelia molliuscula along with P.
ryssolea from S. Russia, from the Asiatic steppes and from Alpine regions. Mereschkovsky[923]
has also recorded from the Crimea Parmelia vagans, probably derived from P. conspersa f. vaga
(f. nov.). It drifts about in small rather flattened bits, and, like other erratics, it never fruits.
Meyer[924] long ago described the development of wandering lichens: scraps that were torn
from the parent thallus continued to grow if there were sufficient moisture, but at the same
time undergoing considerable change in appearance. The dark colour of the under surface
disappears in the frequently altered position, as the lobes grow out into narrow intermingling
fronds forming a more or less compact spherical mass; the rhizoids also become modified and,
if near the edge, grow out into thread-like structures which bind the mass together. Meyer says
that “wanderers” have been noted as belonging to Parmelia acetabulum, Platysma glaucum and
Anaptychia ciliaris.
Fig. 121. Parmelia revoluta var. concentrica Cromb. a, plant on flint with
detached fragment; b, upper surface of three specimens; c, three
specimens as found on chalk downs; d, specimens in section showing
central cavity (S. H., Photo.).
The most notable instance in Britain of the “erratic” habit is that of Parmelia
revoluta var. concentrica (Fig. 121), first found on Melbury Hill near Shaftesbury,
Dorset, and described as “a spherical unattached lichen which rolls on the exposed
downs.” It has recently been observed on the downs near Seaford in Sussex, where,
however, it seems to be confined to a small area about eight acres in extent which is
exposed to south-west winds. The lichen is freely distributed over this locality. To R.
Paulson and Somerville Hastings[925] we owe an account of the occurrence and
origin of the revoluta wanderers. The specimens vary considerably in shape and size,
and measure from 1 to 7 cm. in longest diameter. Very few are truly spherical, some
are more or less flattened and many are quite irregular. The revolute edges of the
overlapping lobes give a rough exterior to the balls, which thereby become entangled
amongst the grass, etc., and movement is impeded or prevented, except in very high
winds. Crombie[926] had suggested that the concentric plant originated from a
corticolous habitat, but no trees are near the Seaford locality. Eventually specimens
were found growing on flints in the immediate neighbourhood. While still on the
stone the lichen tends to become panniform, a felt of intermingling imbricate lobes is
formed, portions of which, in time, become crowded out and dislodged. When
scattered over the ground, these are liable to be trampled on by sheep or other
animals and so are broken up; each separate piece then forms the nucleus of new
concentric growth.
Crombie[926] observed at Braemar, drifting about on the detritus of Morrone, an
analogous structure in Parmelia omphalodes. He concluded that nodular
excrescences of the thallus had become detached from the rocks on which the lichen
grew; while still attached to the substratum Parmelia omphalodes and the allied
species, P. saxatilis, form dense cushion-like masses.
E. Parasitism
a. General Statement. The parasitism of Strigula complanata, an exotic lichen found
on the leaves of evergreen trees, has been already described[927]; Dufrenoy[928]
records an instance of hyphae from a Parmelia thallus piercing pine-needles through
the stomata and causing considerable injury. Lichen hyphae have attacked and
destroyed the protonemata of mosses. Cases have also been recorded of Usnea and
Ramalina penetrating to the living tissue of the tree on which they grew, and there
may be other similar parasitisms; but these exceptions serve to emphasize the
independent symbiotic growth of lichens.
There are however some lichens belonging to widely diverse genera that have
retained, or reverted to, the saprophytic or parasitic habit of their fungal ancestors,
though the cases that occur are generally of lichens preying on other lichens. The
conditions have been described as those of “antagonistic symbiosis” when one lichen
is hurtful or fatal in its action on the other, and as “parasymbiosis” when the
association does little or no injury to the host. The parasitism of fungi on lichens,
though falling under a different category, in many instances exhibits features akin to
parasymbiosis.
The parasitism of fungus on fungus is not unusual; there are instances of its
occurrence in all the different classes. In the Phycomycetes there are genera wholly
parasitic on other fungi such as Woronina and other Chytridiaceae; Piptocephalus,
one of the Mucorini, is another instance. Cicinnobolus, one of the Sphaeropsideae,
preys on Perisporiae; a species of Cordyceps is found on Elaphomyces, and Orbilia
coccinella on Polyporus; while among Basidiomycetes, Nyctalis, an agaric, grows
always on Russula.
There are few instances of lichens finding a foothold on fungi, for the simple
reason that the latter are too short lived. On the perennial Polyporeae a few have
been recorded by Arnold[929], but these are not described as doing damage to the
host. They are mostly species of Lecidea or of allied genera. Kupfer[930] has also
listed some 15 different lichens that he found on Lenzites sp.
b. Antagonistic Symbiosis. In discussing the nutrition of lichens[931] note has been
taken of the extent to which some species by means of enzymes destroy the thallus
of other lichens in their vicinity and then prey on the dead tissues. A constantly
cited[932] example is that of Lecanora atriseda which in its early stages lives on the
thallus of Rhizocarpon geographicum inhabiting mountain rocks. A detailed
examination of the relationship between these two plants was made by Malme and
later by Bitter[933]. Both writers found that the Lecanora thallus as it advanced
caused a blackening of the Rhizocarpon areolae, the tissues of which were killed by
the burrowing slender filaments of the Lecanora, easily recognized by their longer
cells. The invader thereafter gradually formed its own medulla, gonidial layer and
cortex right over the surface of the destroyed thallus. Lecidea insularis (L.
intumescens) similarly takes possession of and destroys the thallus of Lecanora
glaucoma and Malme[932] strongly suspects that Buellia verruculosa and B. aethalea
may be living on the thallus of Rhizocarpon distinctum with which they are constantly
associated.
Other cases of facultative parasitism have been studied by Hofmann[934], more
especially three different species, Lecanora dispersa, Lecanora sp. and Parmelia
hyperopta, which were found growing on the thick foliose thallus of Dermatocarpon
miniatum. These grew, at first independently, on a wall along with many examples of
Endocarpon on to which they spread as opportunity offered. The thallus of the latter
was in all cases distorted, the area occupied by the invaders being finally killed. The
attacking lichens had benefited materially by the more nutritive substratum: their
apothecia were more abundant and their thallus more luxuriant. The gonidia
especially had profited; they were larger, more brightly coloured, and they increased
more freely. Hoffmann offers the explanation that the strain on the algae of providing
organic food for the hyphal symbiont was relaxed for the time, hence their more
vigorous appearance.
Arthonia subvarians is always parasitic on the apothecia of Lecanora galactina, and
Almquist[935] discovered that the hymenium of the host alone is injured, the
hypothecium and excipulum being left intact.
The “parasitism” of Pertusaria globulifera on Parmelia perlata and P. physodes, as
described by Bitter[936], may also be included under antagonistic symbiosis. The
hyphae pierce the Parmelia thallus, break it up and gradually absorb it. Chemical as
well as mechanical influences are concerned in the work of destruction as both the
fungus and the alga of the victim are dissolved. Lecanora tartarea already dealt with
as a marauding lichen[937] over decaying vegetation may spread also to living
lichens. Fruticose soil species, such as Cetraria aculeata and others, die from the
base and the Lecanora gains entrance to their tissues at the decaying end which is
open.
Arnold[938] speaks of these facultative parasites that have merely changed their
substratum as pseudo-parasites, and he gives a list of instances of such change. In
many cases it is rather the older thalli that are taken possession of, and, in nearly
every case, the invader is some crustaceous species. The plants attacked are
generally ground lichens or more particularly those that inhabit damp localities, such
as Peltigera or Cladonia or certain bark lichens. Drifting soredia or particles of a
lichen would easily take hold of the host thallus and develop in suitable conditions.
To give a few of the instances observed, there have been found, by Arnold, Crombie
and others:
on Peltigera canina: Callopisma cerina, Rinodina turfacea var., Bilimbia obscurata
and Lecanora aurella;
on Peltigera aphthosa: Lecidea decolorans;
on Cladoniae: Bilimbia microcarpa, Bacidia Beckhausii and Urceolaria scruposa,
etc.
Urceolaria (Diploschistes) has a somewhat bulky crustaceous thallus which may be
almost evanescent in its semi-parasitic condition, the only gonidia retained being in
the margin of the apothecia. Nylander[939] found isolated apothecia growing
vigorously on Cladonia squamules.
Hue[940] describes Lecanora aspidophora f. errabunda, an Antarctic lichen, as not
only a wanderer but as a “shameless robber.” It is to be seen everywhere on and
about other lichens, settling small glomeruli of apothecia here and there on the
thallus of Umbilicariae or between the areolae of Buelliae, and always too vigorous to
be ousted from its position.
Bacidia flavovirescens has been regarded by some lichenologists[941] as a parasite
on Baeomyces, but recent work by Tobler[942] seems to have proved that the bright
green thallus is that of the Bacidia.
c. Parasymbiosis. There are certain lichens that are obligative parasites and pass
their whole existence on an alien thallus. They may possibly have degenerated from
the condition of facultative parasitism as the universal history of parasitism is one of
increased dependence on the host, and of growing atrophy of the parasite, but, in
the case of lichens, there is always the peculiar symbiotic condition to be considered:
the parasite produces its own vigorous hyphae and normal healthy fruits, it often
claims only a share of the carbohydrates manufactured by the gonidia. The host
lichen is not destroyed by this parasymbiosis though the tissues are very often
excited to abnormal growth by the presence of the invading organism.
Lauder Lindsay[943] was one of the first to study these “microlichens” as he called
them, and he published descriptions of those he had himself observed on various
hosts. He failed however to discriminate between lichens and parasitic fungi. It is
only by careful research in each case that the affinity to fungi or to lichens can be
determined; very frequently the whole of them, as possessing no visible thallus, have
been classified with fungi, but that view ignores the symbiosis that exists between
the hyphae of the parasite and the gonidia of the host.
Parasitic lichens are rather rare on gelatinous thalli; but even among these, a few
instances have been recorded. Winter[944] has described a species of Leptoraphis,
the perithecia of which are immersed in the thallus of Physma franconicum. The host
is wholly unaffected by the presence of the parasite except for a swelling where it is
situated. The foreign hyphae are easily distinguishable; they wander through the
thallus of the host with their free ends in the mucilage of the gonidial groups from
which they evidently extract nourishment. Species of the lichen genus Obryzum are
also parasitic on gelatinous lichens.
The parasitic genus Abrothallus[945] has been the subject of frequent study. There
are a number of species which occur as little black discs on various thalli of the large
foliose lichens. They were first of all described as parasitic fungi, later Tulasne[946]
affirmed their lichenoid nature as proved by the structure, consistence and long
duration of the apothecia. Lindsay[947] wrote a monograph of the genus dealing
chiefly with Abrothallus Smithii (Buellia Parmeliarum) and A. oxysporus, with their
varieties and forms that occur on several different hosts. In some instances the
thallus is apparently quite unaffected by the presence of Abrothallus, in others, as in
Cetraria glauca, there is considerable hypertrophy produced, the portion of the
thallus on which the parasites are situated showing abnormal growth in the form of
swellings or pustules which may be regarded as gall-formations. Crombie[948] points
this out in a note on C. glauca var. ampullacea, figured first by Dillenius, which is
merely a swollen condition due to the presence of Abrothallus.
The internal structure and behaviour of Abrothallus has more recently been
followed in detail by Kotte[949]. He recognized a number of different species growing
on various thalli of Parmelia and Cetraria, but Abrothallus Cetrariae was the only one
that produced gall-formation. The mycelium of the parasite in this instance
penetrates to the medulla of the host lichen as a loose weft of hyphae which are
divided into more or less elongate cells. These send out side branches, which grow
towards the algal cells, and by their short-celled filaments clasp them exactly in the
same way as do the normal lichen hyphae. Thus in the neighbourhood of the
parasite an algal cell may be surrounded by the hyphae not only of the host, but also
by those of Abrothallus. The two different hyphae can generally be distinguished by
their reaction to iodine: in some cases Abrothallus hyphae take the stain, in others
the host hyphae. In addition to apothecia, spermogonia or pycnidia are produced,
but in one of the species examined by Kotte, Abrothallus Peyritschii on Cetraria
caperata, there was no spermogonial wall formed. The hyphae also penetrate the
host soredia or isidia, so that on the dispersal of these vegetative bodies the
perpetuation of both organisms is secured in the new growth.
Abrothallus draws its organic food from the gonidia in the same way as the host
species, and possibly the parasitic hyphae obtain also water and inorganic food along
with the host hyphae. They have been traced down to the rhizinae and may even
reach the hypothallus, but no injury to the host has been detected. It is a case of
joint symbiosis and not of parasitism. Microscopic research has therefore justified the
inclusion of these and other forms among lichens.
d. Parasymbiosis of Fungi. There occur on lichens, certain parasites classed as fungi
which at an early stage are more or less parasymbionts of the host; as growth
advances they may become parasitic and cause serious damage, killing the tissues
on which they have settled.
Zopf[950] found several instances of such parasymbiosis in his study of fungal
parasites, such as Rhymbocarpus punctiformis, a minute Discomycete which inhabits
the thallus of Rhizocarpon geographicum. By means of staining reagents he was able
to trace the course of the parasitic hyphae, and found that they travelled towards the
gonidia and clasped them lichen-wise without damaging them, since these remained
green and capable of division. At no stage was any harm caused to the host by the
alien organism. Another instance he observed was that of Conida rubescens on the
thallus of Rhizocarpon epipolium. By means of fine sections through the apothecia of
Conida and the thallus of the host, he proved the presence of numerous gonidia in
the subhymenial tissue, these being closely surrounded by the hyphae of the
parasite, and entirely undamaged: they retained their green colour, and in size and
form were unchanged. Zopf[951] at first described these parasites as fungi though
later[951] he allows that they may represent lower forms of lichens.
Tobler[952] has added two more of these parasymbiotic species on the border line
between lichens and fungi, similar to those described by Zopf. One of these,
Phacopsis vulpina, belonging to the fungus family Celidiaceae, is parasitic on Letharia
vulpina. The fronds of the host plant are considerably altered in form by its presence,
being more branched and curly. Where the parasite settles a swelling arises filled
with its hyphae, and the host gonidia almost disappear from the immediate
neighbourhood, only a few “nests” being found and these very mucilaginous. These
nests as well as single gonidia are surrounded by Phacopsis hyphae which have
gradually displaced those of the Letharia thallus. The gonidia are excited to division
and increase in number on contact with either lichen or fungus hyphae, but in the
latter case the increase is more abundant owing doubtless to a more powerful
chemical irritant in the fungus. As development advances, the Phacopsis hyphae
multiply to the exclusion of both lichen hyphae and gonidia from the area of
invasion. Finally the host cortex is split, the fungus bursts through, and the tissue
beneath the parasite becomes brown and dead. Phacopsis begins as a
“parasymbiont,” then becomes parasitic, and is at last saprophytic on the dead cells.
The hyphae travel down into the medulla of the host and also into the soredial
outgrowths, and are dispersed along with the host. The effect of Verrucula on the
host thallus may also be cited[953].
Tobler gives the results of his examination of still another fungus, Karschia
destructans. It becomes established on the thallus of Chaenotheca chrysocephala
and its hyphae gradually penetrate down to the underlying bark (larch). The lichen
thallus beneath the fungus is killed, but gonidia in the vicinity are sometimes
clasped: Karschia also is thus a parasymbiont, then a parasite, and finally a
saprophyte.
Elenkin[954] describes certain fungi which to some extent are parasymbionts. One
of these, Conidella urceolata n. sp., grew on forms of Lecanora esculenta. The other,
a stroma-forming species, had invaded the thallus of Parmelia molliuscula, where it
caused gall-formation. As the growth of the gall was due to the co-operation of the
lichen gonidia, the fungus must at first have been a parasymbiont. Only dead gonidia
were present in the stroma; probably they had been digested by the parasite.
Because of the stroma Elenkin placed the fungus in a new genus,
Trematosphaeriopsis.
e. Fungi Parasitic on Lichens. A solution or extract of lichen thallus is a very
advantageous medium in which to grow fungi. It is therefore not surprising that
lichens are a favourite habitat for parasitic fungi. Stahl[955] has noted that the lichens
themselves flourish best where there is frequent moistening by rain or dew with
equally frequent drying which effectively prevents the growth of fungi. Species of
Peltigera are however able to live in damp conditions: without being injured, they
have been observed to maintain their vigour when cultivated in a very moist
hothouse while all the other forms experimented with were attacked and finally
destroyed by various fungi.
Lindsay[956] devoted a great deal of attention to the microscopic study of the
minute fruiting bodies so frequently present on lichen thalli and published
descriptions of microlichens, microfungi and spermogonia. He and others naturally
considered these parasitic organisms to be in many cases either the spermogonia or
pycnidia of the lichen itself. It is often not easy to determine their relationship or
their exact systematic position; many of them are still doubtful forms.
There exists however a very large number of fully recognized parasitic microfungi
belonging to various genera. Lindsay discovered many of them. Zopf[957] has given
exact descriptions of a series of forms, with special reference to their effect on the
host thallus. In an early paper he described a species, Pleospora collematum, that he
found on Physma compactum and other Collemaceae. The hyphae of the parasite
differed from those of the host in being of a yellow colour; they did not penetrate or
spread far, being restricted to rhizoid-like filaments at the base of their fruiting
bodies (perithecia and pycnidia). Their presence caused a slight protuberance but
otherwise did no harm to the host; the Nostoc cells in their immediate vicinity were
even more brightly coloured than in other parts of the thallus. In another paper[958]
he gives an instance of gall-formation in Collema pulposum induced by the presence
of the fungus Didymosphaeria pulposi. Small protuberances were formed on the
margins of the apothecia, more rarely on the lobes of the thallus, each one the seat
of a perithecium of the fungus. No damage was done to either constituent of the
thallus.
Agyrium flavescens grows parasitically on the under surface of Peltigera
polydactyla. M. and Mme Moreau[959] found that the hyphae of the fungus spread
between the medullary filaments of the lichen; no haustoria were observed. The
mature fruiting body had no distinct excipulum, but was surrounded by a layer of
dead lichen cells.
It is not easy to determine the difference between parasites that are of fungal
nature and those that are lichenoid; but as a general rule the fungi may be
recognized by their more transient character, very frequently by their effect on the
host thallus, which is more harmful than that produced by lichens, and generally by
their affinity to fungi rather than to lichens. Opinions differ and will continue to differ
on this very difficult question.
The number of such fungi determined and classified has gradually increased, and
now extends to a very long list. Even as far back as 1896 Zopf reckoned up 800
instances of parasitism of 400 species of fungi on about 350 different lichens and
many more have been added. Abbé Vouaux[960] is the latest writer on the subject,
but his work is mostly a compilation of species already known. He finds
representatives of these parasites in nine families of Pyrenomycetes and six of
Discomycetes. He leaves out of account the much debated Coniocarps, but he
includes with fungi all those that have been proved to be parasymbiotic, such as
Abrothallus.
A number of fungus genera, such as Conida, etc., are parasitic only on lichens.
Most of them have one host only; others, such as Tichothecium pygmaeum, live on a
number of different thalli. Crustaceous species are often selected by the parasites,
and no great damage, if any, is caused to these hosts, except when the fungus is
seated on the disc of the apothecium, so that the spore-bearing capacity is lessened
or destroyed.
In some of the larger lichens, however, harmful effects are more visible. In Lobaria
pulmonaria, the fruits of which are attacked by the Discomycete, Celidium
Stictarum[961], there is at first induced an increased and unusual formation of lichen
apothecia. These apothecia are normally seated for the most part on the margins of
the lobes or pustules, but when they are invaded by the fungus, they appear also in
the hollows between the pustules and even on the under surface of the thallus. In
the large majority of cases the fungus is partly or entirely embedded in the thallus;
the gonidia in the vicinity may remain green and healthy, or all the tissues in the
immediate neighbourhood of the parasite may be killed.
f. Mycetozoa Parasitic on Lichens. Mycetozoa live mostly on decayed wood, leaves,
humus, etc. One minute species, Listerella paradoxa, always inhabits the podetia of
Cladonia rangiferina. Another species, Hymenobolina parasitica, was first detected
and described by Zukal[962] as a true parasite on the thallus of Physciaceae; it has
since been recorded in the British Islands on Parmeliae[963]. This peculiar organism
differs from other mycetozoa in that the spores on germination produce amoebae.
These unite to form a rose-red plasmodium which slowly burrows into the lichen
thallus and feeds on the living hyphae. It is a minute species, but when abundant
the plasmodia can just be detected with the naked eye as rosy specks scattered over
the surface of the lichen. Later the grey sporangia are produced on the same areas.
F. Diseases of Lichens
a. Caused by Parasitism. Zopf[964] has stated that of all plants, lichens are the most
subject to disease, reckoning as diseases all the instances of parasitism by fungi or
by other lichens. There are however only rare instances in which total destruction or
indeed any permanent harm to the host is the result of such parasitism. At worst the
trouble is localized and does not affect the organism as a whole. Some of these
cases have been already noted under antagonistic symbiosis or parasymbiosis.
Several instances have however been recorded where real injury has been caused by
the penetration of some undetermined fungus mycelium. Zukal[965] records two such
observed by him in Parmelia encausta and Physcia villosa: the thallus of the former
was dwarfed and deformed by the presence of the alien mycelium, the latter was
excited to abnormal proliferation.
b. Caused by crowding. Lichens suffer frequently from being overgrown by other
lichens; they may also be crowded out by other plants. My attention was called by
Mr P. Thompson to a burnt plot of ground in Epping Forest, which, after the fire, had
been colonized by Peltigera spuria. In the course of a few years, other vegetation
had followed, depriving the lichen of space and light and gradually driving it out.
When last examined only a few miserable specimens remained, and these were
reduced in vitality by an attack of the lichen parasite Illosporium carneum.
c. Caused by adverse conditions. Zukal considers as pathological, at least in origin, the
cracking of the thallus so frequent in crustaceous lichens as well as in the more
highly developed forms. As the cracks are beneficial in the aeration of the plant, they
can hardly be regarded as symptoms of a diseased condition. The more evident
ringed breaks in the cortex of Usneae, due probably to wind action, have more
reason to be so regarded; they are most pronounced in Usnea articulata, where the
portions bounded by the rings are contracted and swollen, and a hollow space is
formed between the cortex and the central axis. The swellings that are produced on
lichen thalli, such as those of Umbilicaria and some species of Gyrophora, due to
intercalary growth are normal to the plant, though occasionally the swollen weaker
portions may become ruptured and the cortex be thrown off. As pathological also
must be regarded the loss of cortex sometimes occasioned by excessive soredial
formation at the margins of the lobes: the upper cortex may be rolled back and
eventually torn away; the gonidial layer is exposed and transformed into soredia
which are swept away by the wind and rain, till finally only traces of the lower cortex
are left.
Zukal[966] has instanced, as a case of diseased condition observed by him, the
undue thickening of the cortex in Pertusaria communis whereby the formation of the
fruiting bodies is inhibited and even vegetative development is rendered impossible.
There arrives finally a stage when splitting takes place and the whole thallus breaks
down and disappears. As a rule however there need be no limit to the age of the
lichen plant. There is no vital point or area in the thallus; injury of one part leaves
the rest unhurt, and any fragment in growing condition, if it combines both
symbionts, can carry on the life of the plant, the constant renewal of gonidia
preventing either decay or death. Barring accidents many lichens might exist as long
as the world endures.
G. Harmful Effect of Lichens
One lichen only, Strigula complanata, a tropical species, has been proved to be
truly and constantly parasitic. It grows on the surface of thick leathery leaves such as
those of Camellia[967], etc. and the alga and fungus both penetrate the epidermis
and burrow beneath the cuticle and outer cells, causing them to become brown. It
undoubtedly injures the leaves.
Friedrich[968] has given an isolated instance of the hold-fast hyphae of Usnea
piercing through the cortex to the living tissue of the host, and not only destroying
the middle lamella by absorption, but entering the cells. The Usnea plant was
characterized by exceptionally vigorous growth. Practically all corticolous lichens are
epiphytic and the injury they cause is of an accidental nature. Crustaceous species
on the outer bark occupy the dead cortical layers and seem to be entirely
harmless[969]. The larger foliose and fruticose forms are not so innocuous: by their
abundant enveloping growth they hinder the entrance of air and moisture, and thus
impede the life of the higher plant. Gleditsch[970], one of the earliest writers on
Forestry, first indicated the possibly harmful effect of lichens especially on young
trees and “in addition,” he says, “they serve as cover for large numbers of small
insects which are hurtful in many ways to the trees.” Lindau[971] pointed out the
damage done to pine-needles by Xanthoria parietina which grew round them like a
cuff and probably choked the stomata, the leaves so clothed being mostly withered.
Dufrenoy[972] states that he found the hyphae of a Parmelia entering a pine-needle
by the stomata, and that the starch disappeared from the neighbouring parenchyma
the cells of which tended to disintegrate.
It is no uncommon sight to see neglected fruit trees with their branches crowded
with various lichens, Evernia prunastri, Ramalina farinacea, etc. Such lichens often
find the lenticels a convenient opening for their hold-fasts and exercise a smothering
effect on the trees. Lilian Porter[973] distinctly states that Ramalinae by their
penetrating bases damage the tissues of the trees. The presence of lichens is
however generally due to unhealthy conditions already at work. Friedrich[974]
reported of a forest which he examined, in which the atmospheric moisture was very
high, with the soil water scarce, that those trees that were best supplied with soil
water were free from lichens, while those with little water at the base bore dead
branches which gave foothold to a rich growth of the epiphytes.
Experiments to free fruit trees from their coating of lichens were made by
Waite[975]. With a whitewash brush he painted over the infested branches with
solutions of Bordeaux mixture of varying strength, and found that this solution,
commonly in use as a fungicide, was entirely successful. The trees were washed
down about the middle of March, and some three weeks later the lichens were all
dead, the fruticose and foliose forms had changed in colour to a yellowish or
brownish tint and were drooping and shrivelled.
Waite was of opinion that the lichens did considerable damage to the trees, but it
has been held by others that in very cold climates they may provide protection
against severe frost. Instances of damage are however asserted by Bouly de
Lesdain[976]. The bark of willows he found was a favourite habitat of numerous
lichens: certain species, such as Xanthoria parietina, completely surrounded the
branches, closing the stomata; others, such as Physcia ascendens, by the mechanical
strain of the rhizoids, first wet and then dry, gradually loosened the outer bark and
gave entry to fungi which completed the work of destruction.
H. Gall-Formation
Several instances of gall-formation to a limited extent have been already noted as
caused by parasitic fungi or lichens. Greater abnormality of development is induced
in a few species by the presence of minute animals, mites, wood-lice, etc. Zopf[977]
noted these deformations of the thallus in specimens of Ramalina Kullensis collected
on the coasts of Sweden. The fronds were frequently swollen in a sausage-like
manner, and branching was hindered or altogether prevented; apothecia were rarely
formed, though pycnidia were abundant. Here and there, on the swollen portions of
the thallus, small holes could be detected and other larger openings of elliptical
outline, about 1-1-1/2 mm. in diameter, the margins of which had a nibbled
appearance. Three types of small articulated animals were found within the
openings: species of mites, spiders and wood-lice. Mites were the most constant and
were more or less abundant in all the deformations; frequently a minute Diplopodon
belonging to the genus Polyxenus was also met with.
Zopf came to the conclusion that the gall-formation was mainly due to the mites:
they eat out the medulla and possibly through some chemical irritation excite the
algal zone and cortex to more active growth, so that an extensive tangential
development takes place. The small spiders may exercise the same power; evidently
the larger holes were formed by them.
Later Zopf added to gall-deformed plants Ramalina scopulorum var. incrassata and
R. cuspidata var. crassa. He found in the hollow swollen fronds abundant evidence of
mites, but whether identical with those that attacked R. Kullensis could not be
determined. These two Ramalinae are maritime species; they are morphologically
identical, as are also the deformed varieties, and the presence of mites, excreta, etc.,
are plainly visible in our British specimens.
Bouly de Lesdain[978] found evidence of mite action in Ramalina farinacea
collected from Pinus sylvestris on the dunes near Dunkirk. The cortex had been
eaten off either by mites or by a small mollusc (Pupa muscorum) and the fronds had
collapsed to a more or less convex compact mass. Somewhat similar deformations,
though less pronounced, were observed in other Ramalinae.
In Cladonia sylvatica and also in Cl. rangiformis Lesdain has indicated ff. abortiva
Harm. as evidently the result of insect attack. In both cases the tips of the podetia
are swollen, brown, bent and shrivelled.
One of the most curious and constant effects, also worked out by Lesdain, occurs
in Physcia hispida (Ph. stellaris var. tenella). In that lichen the gonidia at the tips of
the fronds are scooped out and eaten by mites, so that the upper cortex becomes
separated from the lower part of the thallus. As the hyphae of the cortex continue to
develop, an arched hood is formed of a whitish shell-like appearance and powdery
inside. Sometimes the mites penetrate at one point only, at other times the attack is
at several places which may ultimately coalesce into one large cavity. In a
crustaceous species, Caloplaca (Placodium) citrina he found constant evidence of the
disturbing effect of the small creatures, which by their action caused the areolae of
the thallus to grow into minute adherent squamules. A pathological variety, which he
calls var. sorediosa, is distinguished by the presence of cup-like hollows which are
scooped out by Acarinae and are filled by yellowish soredia. In another form, var.
maritima, the margins of the areolae, occasionally the whole surface, become
powdery with a citrine yellow efflorescence as a result of their nibbling.
Zukal[979] adds to the deformations due to organic agents, the hypertrophies and
abnormalities caused by climatic conditions. He finds such irregularities of structure
more especially developed in countries with a very limited rainfall, as in certain
districts of Chili, Australia and Africa, where changes in cortex and rhizoids and
proliferations of the thallus testify to the disturbance of normal development.
Making use of Python 1st Edition Rashi Gupta
CHAPTER VII
PHYLOGENY
I. GENERAL STATEMENT
A. Origin of Lichens
Though lichens are very old members of the vegetable kingdom, as symbiotic
plants they yet date necessarily from a time subsequent to the evolution of their
component symbionts. Phylogeny of lichens begins with symbiosis.
The algae, which belong to those families of Chlorophyceae and Myxophyceae that
live on dry land, had become aerial before their association with fungi to form
lichens. They must have been as fully developed then as now, since it is possible to
refer them to the genus or sometimes even to the species of free-living forms. The
fungus hyphae have combined with a considerable number of different algae, so
that, even as regards the algal symbiont, lichens are truly polyphyletic in origin.
The fungus is, however, the dominant partner, and the principal line of
development must be traced through it, as it provides the reproductive organs of the
plant. Representatives of two great groups of fungi are associated with lichens:
Basidiomycetes, found in only a few genera, and Ascomycetes which form with the
various algae the great bulk of lichen families. In respect of their fungal constituents
lichens are also polyphyletic, and more especially in the Ascolichens which can be
traced back to several starting points. But though lichens have no common origin,
the manner of life is common to them all and has influenced them all in certain
directions: they are fitted for a much longer existence than that of the fungi from
which they started; and both the thallus and the fruiting bodies—at least in the sub-
class Ascolichens—can persist through great climatic changes, and can pass
unharmed through prolonged periods of latent or suspended vitality.
Another striking note of similarity that runs through the members of this sub-class,
with perhaps the exception of the gelatinous lichens, is the formation of lichen-acids
which are excreted by the fungus. These substances are peculiar to lichens and go
far to mark their autonomy. The production of the acids and the many changes
evolved in the vegetative thallus suggest the great antiquity of lichens.
B. Algal Ancestors
It is unnecessary to look far for the algae as they have persisted through the ages
in the same form both without and within the lichen thallus. By many early
lichenologists the free-living algae, similar in type to lichen algae, were even
supposed to be lichen gonidia in a depauperate condition and were, for that reason,
termed by Wallroth “unfortunate brood-cells.” In the condition of symbiosis they may
be considerably modified, but they revert to their normal form, and resume their
normal life-history of spore production, etc., under suitable and free culture. The
different algae taking part in lichen-formation have been treated in an earlier
chapter[980].
C. Fungal Ancestors
a. Hymenolichens. The problem of the fungal origin in this sub-class is comparatively
simple. It contains but three genera of tropical lichens which are all associated with
Myxophyceae, and the fungus in them, to judge from the form and habit of the
plants, is a member of the Thelephoraceae. It may be that Hymenolichens are of
comparatively recent origin and that the fungi belonging to the Basidiomycetes had,
in the course of time, become less labile and less capable of originating a new
method of existence. Whatever the reason, they lag immeasurably behind
Ascomycetes in the formation of lichens.
b. Ascolichens. Lichens are again polyphyletic within this sub-class. The main
groups from which they are derived are evident. Whether there has been a series of
origins within the different groups or a development from one starting point in each
it would be difficult to determine. In any case great changes have taken place after
symbiosis became established.
The main divisions within the Ascolichens are related to fungi thus:
Series 1. Pyrenocarpineae }
to Pyrenomycetes.
2. Coniocarpineae }
3. Graphidineae to Hysteriaceae.
4. Cyclocarpineae to Discomycetes.
II. THE REPRODUCTIVE ORGANS
A. Theories of Descent in Ascolichens
It has been suggested that ascomycetous fungi, from which Ascolichens are
directly derived, are allied to the Florideae, owing to the appearance of a trichogyne
in the carpogonium of both groups. That organ in the red seaweeds is a long delicate
cell in direct communication with the egg-cell of the carpogonium. It is a structure
adapted to totally submerged conditions, and fitted to attach the floating spermatia.
In fungi there is also a structure considered as a trichogyne[981], which, in the
Laboulbeniales, is a free, simple or branching organ. There is no other instance of
any similar emergent cell or cells connected with the ascogonium of the
Ascomycetes, though the term has been applied in these fungi to certain short
hyphal branches from the ascogonium which remain embedded in the tissue. In the
Ascomycetes examined all traces of emergent receptive organs, if they ever existed,
have now disappeared; in some few there are possible internal survivals which never
reach the surface.
In Ascolichens, on the contrary, the “trichogyne,” a septate hyphal branch
extending upwards from the ascogonium, and generally reaching the open, has been
demonstrated in all the different groups except, as yet, in the Coniocarpineae which
have not been investigated. Its presence is a strong point in the argument of those
who believe in the Floridean ancestry of the Ascomycetes. It should be clearly borne
in mind that Ascolichens are evolved from the Ascomycetes: these latter stand
between them and any more remote ancestry.
In the Ascomycetes, there is a recognized progression of development in the form
of the sporophore from the closed perithecium of the Pyrenomycetes and possibly
through the Hysteriaceae, which are partially closed, to the open ascocarp of the
Discomycetes. If the fungal and lichenoid “trichogyne” is homologous with the
carpogonial organ in the Florideae, then it must have been retained in all the groups
of Ascomycetes as an emergent structure, and as such passed on from them to their
lichen derivatives. Has that organ then disappeared from fungi since symbiosis
began? There is no trace of it now, except as already stated in Laboulbeniales with
which lichens are unconnected.
Were Ascolichens monophyletic in origin, one could more easily suppose that both
the fungal and lichen series might have started at some early stage from a common
fungal ancestor possessing a well-developed trichogyne which has persisted in
lichens, but has been reduced to insignificance in fungi, while fruit development
proceeded on parallel lines in both. There is no evidence that such progression has
taken place among lichens; the theory of a polyphyletic origin for the different series
seems to be unassailable. At the same time, there is no evidence to show in which
series symbiosis started first.
It is more reasonable to accept the polyphyletic origin, as outlined above, from
forms that had already lost the trichogyne, if they ever really possessed it, and to
regard the lichen trichogyne as a new organ developing in lichens in response to
some requirement of the deep-seated ascogonium. Its sexual function still awaits
satisfactory proof, and it is wiser to withhold judgment as to the service it renders to
the developing fruit.
B. Relation of Lichens to Fungi
a. Pyrenocarpineae. In Phycolichens (containing blue-green gonidia) and especially in
the gelatinous forms, fructification is nearly always a more or less open apothecium.
The general absence of the perithecial type is doubtless due to the gelatinous
consistency of the vegetative structure; it is by the aid of moisture that the hymenial
elements become turgid enough to secure the ejection of the spores through the
narrow ostiole of the perithecium, and this process would be frustrated were the
surrounding and enveloping thallus also gelatinous. There is only one minutely
foliose or fruticose gelatinous family, the Pyrenidiaceae, in which Pyrenomycetes are
established, and the gonidia, even though blue-green, have lost the gelatinous
sheath and do not swell up.
In Archilichens (with bright-green gonidia), perithecial fruits occur frequently; they
are nearly always simple and solitary; in only a few families with a few
representatives, is there any approach to the stroma formation so marked among
fungi. The single perithecium is generally semi-immersed in the thallus. It may be
completely surrounded by a hyphal “entire” wall, either soft and waxy or dark
coloured and somewhat carbonaceous. In numerous species the outer protective wall
covers only the upper portion that projects beyond the thallus, and such a
perithecium is described as “dimidiate,” a type of fruit occurring in several genera,
though rare among fungi.
As to internal structure, there is a dissolution and disappearance of the paraphyses
in some genera, their protective function not being so necessary in closed fruits, a
character paralleled in fungi. There is a great variety of spore changes, from being
minute, simple and colourless, to varied septation, general increase in size, and
brown colouration. The different types may be traced to fungal ancestors with
somewhat similar spores, but more generally they have developed within the lichen
series. From the life of the individual it is possible to follow the course of evolution,
and the spores of all species begin as simple, colourless bodies; in some genera they
remain so, in others they undergo more or less change before reaching the final
stage of colour or septation that marks the mature condition.
As regards direct fungal ancestors, the Pyrenocarpineae, with solitary perithecia,
are nearest in fruit structure to the Mycosphaerellaceae, in which family are included
several fungus genera that are parasitic on lichens such as Ticothecium, Müllerella,
etc. In that family occurs also the genus Stigmatea, in which the perithecia in form
and structure are very similar to dimidiate Verrucariae.
Zahlbruckner[982] has suggested as the starting point for the Verrucariaceae the
fungus genus Verrucula. It was established by Steiner[983] to include two species, V.
cahirensis and V. aegyptica, their perithecia being exactly similar to those of
Verrucaria[984] in which genus they were originally placed. Both are parasitic on
species of Caloplaca (Placodium). The former, on C. gilvella, transforms the host
thallus to the appearance of a minutely lobed Placodium; the latter occupies an
island-like area in the centre of the thallus of Caloplaca interveniens, and gives it,
with its accompanying parasite, the character of an Endopyrenium (Dermatocarpon),
while the rest of the thallus is normal and fertile.
Zahlbruckner may have argued rightly, but it is also possible to regard these rare
desert species as reversions from an originally symbiotic to a purely parasitic
condition. Reinke came to the conclusion that if a parasitic species were derived
directly from a lichen type, then it must still rank as a lichen, a view that has a direct
bearing on the question. The parallel family of Pyrenulaceae which have Trentepohlia
gonidia is considered by Zahlbruckner to have originated from the fungus genus
Didymella.
Compound or stromatoid fructifications occur once and again in lichen families;
but, according to Wainio[985], there is no true stroma formation, only a
pseudostroma resulting from adhesions and agglomerations of the thalline envelopes
or from cohesions of the margins of developing fruit bodies. These pseudostromata
are present in the genera Chiodecton and Glyphis (Graphidineae) and in
Trypethelium, Mycoporium, etc. (Pyrenocarpineae). This view of the nature of the
compound fruits is strengthened, as Wainio points out, by the presence in certain
species of single apothecia or perithecia on the same specimen as the stromatoid
fruits.
b. Coniocarpineae. This subseries is entirely isolated. Its peculiarity lies in the
character of the mature fruit in which the spores, owing to the early breaking down
of the asci, lie as a loose mass in the hymenium, while dispersal is delayed for an
indefinite time. This type of fruit, termed a mazaedium by Acharius, is in the form of
a stalked or sessile roundish head—the capitulum—closed at first and only half-open
at maturity rarely, as in Cyphelium, an exposed disc. There is a suggestion, but only
a suggestion, of a similar fructification in the tropical fungus Camillea in which there
is sometimes a stalk with one or more perithecia at the tip, and in some species early
disintegration of the asci, leaving spore masses[986]. But neither in fungi nor in other
lichens is there any obvious connection with Coniocarpineae. In some of the genera
the fungus alone forms the stalk and the wall of the capitulum; in others the thallus
shares in the fruit-formation growing around it as an amphithecium.
The semi-closed fruits point to their affinity with Pyrenolichens, though they are
more advanced than these judging from the thalline wall that is present in some
genera and also from the half-open disc at maturity. The latter feature has influenced
some systematists to classify the whole subseries among Cyclocarpineae. The
thallus, as in Sphaerophorus, reaches a high degree of fruticose development; in
other genera it is crustaceous without any formation of cortex, while in several
genera or species it is non-existent, the fruits being parasites on the thalli of other
lichens or saprophytes on dead wood, humus, etc. These latter—both parasites and
saprophytes—are included by Rehm[987] and others among fungi, which has involved
the breaking up of this very distinctive series. Rehm has thus published as
Discomycetes the lichen genera Sphinctrina, Cyphelium, Coniocybe, Acolium,
Calicium and Stenocybe, since some or all of their species are regarded by him as
fungi.
Reinke[988] in his lichen studies states that it might not be impossible for a
saprophytic fungus to be derived from a crustaceous lichen—a case of reversion—but
that no such instance was then known. More exact studies[989] of parasymbiosis and
antagonistic symbiosis have shown the wide range of possible life-conditions, and
such a reversion does not seem improbable. We must also bear in mind that in
suitable cultures, lichen hyphae can be grown without gonidia: they develop in that
case as saprophytes.
On Reinke’s[988] view, however, that these saprophytic species, belonging to
different genera in the Coniocarpineae, are true fungi, they would represent the
direct and closely related ancestors of the corresponding lichen genera, giving a
polyphyletic origin within this group. As fungus genera he has united them in
Protocaliciaceae, and the representatives among fungi he distinguishes, as does
Wainio[990], under such names as Mycocalicium and Mycoconiocybe.
If we might consider the saprophytic forms as also retrogressive lichens, a
monophyletic origin from some remote fungal ancestor would prove a more
satisfactory solution of the inheritance problem. This view is even supported by a
comparison Reinke himself has drawn between the development of the fructification
in Mycocalicium parietinum, a saprophyte, and in his view a fungus, and
Chaenotheca chrysocephala, a closely allied lichen. Both grow on old timber. In the
former (the fungus), the mycelium pervades the outer weathered wood-cells, and
the fruit stalk rises from a clump of brownish hyphae; there is no trace of gonidia.
Chaenotheca chrysocephala differs in the presence of gonidia which are associated
with the mycelium in scattered granular warts; but the fruit stalk here also rises
directly from the mycelium between the granules. The presence of a lichen thallus
chiefly differentiates between the two plants, and this thallus is not a casual or
recent association; it is constant and of great antiquity as it is richly provided with
lichen-acids.
Reinke has indicated the course of evolution within the series but that is on the
lines of thalline development and will be considered later.
c. Graphidineae. This series contains a considerable variety of lichen forms, but all
possess to a more or less marked degree the linear form of fructification termed a
“lirella” which has only a slit-like opening. There is a tendency to round discoid fruits
in the Roccellae and also in the Arthoniae; the apothecia of the latter, called by early
lichenologists “ardellae,” are without margins. In nearly all there is a formation of
carbonaceous black tissue either in the hypothecium or in the proper margins. In
some of them the paraphyses are branched and dark at the tips, the branches
interlocking to form a strong protective epithecium. There are, however, constant
exceptions, in some particular, to any generalization in genera and in species. Müller-
Argau’s[991] pronouncement might be held to have special reference to
Graphidineae: “that in any genus, species or groups of species are to be found which
outwardly shew something that is peculiar, though of slight importance.” The most
constant type of gonidium is Trentepohlia, but Palmella and Phycopeltis occasionally
occur. The spores are various in colour and form; they are rarely simple.
The genus Arthonia is derived from a member of the Patellariaceae, from which
family many of the Discomycetes have arisen. The course of development does not
follow from a closed to an open fruit; the apothecium is open from the first, and
growth proceeds from the centre outwards, the fertile cells gradually pushing aside
the sterile tissue of the exterior. The affinity of Xylographa (with Palmella gonidia) is
to be found in Stictis in the fungal family Stictidaceae, the apothecia of Stictis being
at first closed, then open, and with a thick margin; Xylographa has a more elongate
lirella fruit, though otherwise very similar, and has a very reduced thallus. Rehm[992]
has classified Xylographa as a fungus.
The genera with linear apothecia are closely connected with Hysteriaceae, and
evidently inherit their fruit form severally from that family. There is thus ample
evidence of polyphyletic descent in the series. Stromatoid fruits occur in
Chiodectonaceae, with deeply sunk, almost closed disc, but they have evidently
evolved within the series, possibly from a dividing up of the lirellae.
In Graphidineae there are also forms, more especially in Arthoniaceae, on the
border line between lichens and fungi: those with gonidia being classified as lichens,
those without gonidia having been placed in corresponding genera of fungi. These
latter athalline species live as parasites or saprophytes.
The larger number of genera have a poorly developed thallus; in many of them it
is embedded within the outer periderm-cells of trees, and is known as
“hypophloeodal.” But in some families, such as Roccellaceae, the thallus attains a
very advanced form and a very high production of acids.
The conception of Graphidineae as a whole is puzzling, but one or other
characteristic has brought the various members within the series. It is in this respect
an epitome of the lichen class of which the different groups, with all their various
origins and affinities, yet form a distinct and well-defined section of the vegetable
kingdom.
d. Cyclocarpineae. This is by far the largest series of lichens. The genera are
associated with algae belonging both to the Myxophyceae and the Chlorophyceae,
and from the many different combinations are produced great variations in the form
of the vegetative body. The fruit is an emergent, round or roundish disc or open
apothecium in all the members of the series except Pertusariaceae, where it is
partially immersed in thalline “warts.” In its most primitive form, described as
“biatorine” or “lecideine,” it may be soft and waxy (Biatora) or hard and
carbonaceous (Lecidea), in the latter the paraphyses being mostly coloured at the
tips; these are either simple or but sparingly branched, so that the epithecium is a
comparatively slight structure. The outer sterile tissue forms a protective wall or
“proper margin” which may be entirely pushed aside, but generally persists as a
distinct rim round the disc.
A great advance within the series arose when the gonidial elements of the thallus
took part in fruit-formation. In that case not only is the hymenium generally
subtended by a layer of algae, but thalline tissue containing algae grows up around
the fruit, and forms a second wall or thalline margin. This type of apothecium,
termed “lecanorine,” is thus intimately associated with the assimilating tissue and
food supply, and it gains in capacity of ascus renewal and of long duration. This
development from non-marginate to marginate ascomata is necessarily an
accompaniment of symbiosis.
There is no doubt that the Cyclocarpineae derive from some simple form or forms
of Discomycete in the Patellariaceae. The relationship between that family and the
lower Lecideae is very close. Rehm[993] finds the direct ancestors of Lecidea itself in
the fungus genus, Patinella, in which the apothecia are truly lecideine in character—
open, flat and slightly margined, the hypothecium nearly always dark-coloured and
the paraphyses branched, septate, clavate and coloured at the tips, forming a dark
epithecium. More definitely still he describes Patinella atroviridis, a new species he
discovered, as in all respects a Lecidea, but without gonidia.
In the crustaceous Lecideaceae, a number of genera have been delimited on spore
characters—colourless or brown, and simple or variously septate. In Patellariaceae as
described by Rehm are included a number of fungus genera which correspond to
these lichen genera. Only two of them—Patinella and Patellaria—are saprophytic; in
all the other genera of the family, the species with very few exceptions are parasitic
on lichens: they are parasymbionts sharing the algal food supply; in any case, they
thrive on a symbiotic thallus.
Rehm unhesitatingly derives the corresponding lichen genera from these fungi. He
takes no account of the difficulty that if these parasitic (or saprophytic) fungi are
primitive, they have yet appeared either later in time than the lichens on which they
exist, or else in the course of ages they have entirely changed their substratum.
He has traced, for instance, the lichen, Buellia, to a saprophytic fungus species,
Karschia lignyota, to a genus therefore in which most of the species are parasitic on
lichens and have generally been classified as parasitic lichens. There is no advance in
apothecial characters from the fungus, Karschia, to Buellia, merely the change to
symbiosis. It therefore seems more in accordance with facts to regard Buellia as a
genus evolved within the lichen series from Patinella through Lecidea, and to accept
these species of Karschia on the border line as parasitic, or even as saprophytic,
reversions from the lichen status. We may add that while these brown-spored lichens
are fairly abundant, the corresponding athalline or fungus forms are comparatively
few in number, which is exactly what might be expected from plants with a
reversionary history.
Occasionally in biatorine or lecideine species with a slight thalline development all
traces of the thallus disappear after the fructification has reached maturity. The
apothecia, if on wood or humus, appear to be saprophytic and would at first sight be
classified as fungi. They have undoubtedly retained the capacity to live at certain
stages, or in certain conditions, as saprophytes.
The thallus disappears also in some species of the crustaceous genera that
possess apothecia with a thalline margin, and the fruits may be left stranded and
solitary on the normal substratum, or on some neighbouring lichen thallus where
they are more or less parasitic; but as the thalline margin persists, there has been no
question as to their nature and affinity.
Rehm suggests that many species now included among lichens may be ultimately
proved to be fungi; but it is equally possible that the reverse may be the case, as for
instance Bacidia flavovirescens, held by Rehm and others to be a parasitic fungus
species, but since proved by Tobler[994] to be a true lichen.
A note by Lightfoot[995], one of our old-time botanists who gave lichens a
considerable place in his Flora, foreshadows the theory of evolution by gradual
advance, and his views offer a suggestive commentary on the subject under
discussion. He was debating the systematic position of the maritime lichen genus
Lichina, considered then a kind of Fucus, and had observed its similarity with true
lichens. “The cavity,” he writes, “at the top of the fructification (in Lichina) is a proof
how nearly this species of Fucus is related to the scutellated lichens. Nature disdains
to be limited to the systematic rules of human invention. She never makes any
sudden starts from one class or genus to another, but is regularly progressive in all
her works, uniting the various links in the chain of beings by insensible connexions.”
III. THE THALLUS
A. General Outline of Development
a. Preliminary Considerations. The evolution of lichens, as such, has reference mainly
to the thallus. Certain developments of the fructification are evident, but the changes
in the reproductive organs have not kept pace with those of the vegetative
structures: the highest type of fruit, for instance, the apothecium with a thalline
margin, occurs in genera and species with a very primitive vegetative structure as
well as in those that have attained higher development.
Lichens are polyphyletic as regards their algal, as well as their fungal, ancestors,
so that it is impossible to indicate a straight line of progression, but there is a general
process of thalline development which appears once and again in the different phyla.
That process, from simpler to more complicated forms, follows on two lines: on the
one there is the endeavour to increase the assimilating surface, on the other the
tendency to free the plant from the substratum. In both, the aim has been the same,
to secure more favourable conditions for assimilation and aeration. Changes in
structure have been already described[996], and it is only needful to indicate here the
main lines of evolution.
b. Course of Evolution in Hymenolichens. There is but little trace of development in
these lichens. The fungus has retained more or less the form of the ancestral
Thelephora which has a wide-spreading superficial basidiosporous hymenium. Three
genera have been recognized, the differences between them being due to the
position within the thallus, and the form of the Scytonema that constitutes the
gonidium. The highest stage of development and of outward form is reached in Cora,
in which the gonidial zone is central in the tissue and is bounded above and below by
strata of hyphae.
c. Course of Evolution in Ascolichens. It is in the association with Ascomycetes that
evolution and adaptation have had full scope. In that sub-class there are four
constantly recurring and well-marked stages of thalline development. (1) The
earliest, most primitive stage, is the crustaceous: at first an accretion of separate
granules which may finally be united into a continuous crust with a protective
covering of thick-walled amorphous hyphae forming a “decomposed” cortex. The
extension of a granule by growth in one direction upwards and outwards gives
detachment from the substratum, and originates (2) the squamule which is, however,
often of primitive structure and attached to the support, like the granule, by the
medullary hyphae. Further growth of the squamule results in (3) the foliose thallus
with all the adaptations of structure peculiar to that form. In all of these, the
principal area of growth is round the free edges of the thallus. A greater change
takes place in the advance to (4) the fruticose type in which the more active growing
tissue is restricted to the apex, and in which the frond or filament adheres at one
point only to the support, a new series of strengthening and other structures being
evolved at the same time.
The lichen fungi associate, as has been already stated, with two different types of
algae: those combined with the Myxophyceae have been designated Phycolichenes,
those with Chlorophyceae as Archilichenes. The latter predominate, not only in the
number of lichens, but also in the more varied advance of the thallus, although, in
many instances, genera and species of both series may be closely related.
B. Comparative Antiquity of Algal Symbionts
One of the first questions of inheritance concerns the comparative antiquity of the
two gonidial series: with which kind of alga did the fungus first form the symbiotic
relationship? No assistance in solving the problem is afforded by the type of
fructification. The fungus in Archilichens is frequently one of the more primitive
Pyrenomycetes, though more often a Discomycete, while in Phycolichens
Pyrenomycetes are very rare. There is, as already stated, no correlation of advance
between the fruit and the thallus, as the most highly evolved apothecia with well-
formed thalline margins are constantly combined with thalli of low type.
Forssell[997] gave considerable attention to the question of antiquity in his study of
gelatinous crustaceous lichens in the family Pyrenopsidaceae, termed by him
Gloeolichens, and he came to the conclusion that Archilichens represented the older
combination, Phycolichens being comparatively young.
His view is based on a study of the development of certain lichen fungi that seem
able to adapt themselves to either kind of algal symbiont. He found[997] in Euopsis
(Pyrenopsis) granatina, one of the Pyrenopsidaceae, that certain portions of the
thallus contained blue-green algae, while others contained Palmella, and that these
latter, though retrograde in development, might become fertile. The granules with
blue-green gonidia were stronger, more healthy and capable of displacing those with
Palmella, but not of bearing apothecia, though spermogonia were embedded in them
—a first step, according to Forssell, towards the formation of apothecia. These
granules, not having reached a fruiting stage, were reckoned to be of a more recent
type than those associated with Palmella. In other instances, however, the line of
evolution has been undoubtedly from blue-green to more highly evolved bright-green
thalli.
The striking case of similarity between Psoroma hypnorum (bright-green) and
Pannaria rubiginosa (blue-green) may also be adduced. Forssell considers that
Psoroma is the more ancient form, but as the fungus is adapted to associate with
either kind of alga, the type of squamules forming the thallus may be gradually
transformed by the substitution of blue-green for the earlier bright-green—the
Pannaria superseding the Psoroma. There is a close resemblance in the fructification
—that is of the fungus—in these two different lichens.
Hue[998] shares Forssell’s opinion as to the greater antiquity of the bright-green
gonidia and cites the case of Solorina crocea. In that lichen there is a layer of bright-
green gonidia in the usual dorsiventral position, below the upper cortex. Below this
zone there is a second formed entirely of blue-green cells. Hue proved by his study
of development in Solorina that the bright-green were the normal gonidia of the
thallus, and were the only ones present in the growing peripheral areas; the blue-
green were a later addition, and appeared first in small groups at some distance
from the edge of the lobes.
The whole subject of cephalodia-development[999] has a bearing on this question.
These bodies always contain blue-green algae, and are always associated with
Archilichens. Mostly they occur as excrescences, as in Stereocaulon and in Peltigera.
The fungus of the host-lichen though normally adapted to bright-green algae has the
added capacity of forming later a symbiosis with the blue-green. This tendency
generally pervades a whole genus or family, the members of which, as in
Peltigeraceae, are too closely related to allow as a rule of separate classification even
when the algae are totally distinct.
C. Evolution of Phycolichens
The association of lichen-forming fungi with blue-green algae may have taken
place later in time, or may have been less successful than with the bright-green:
they are fewer in number, and the blue-green type of thallus is less highly evolved,
though examples of very considerable development are to be found in such genera
as Peltigera, Sticta or Nephromium.
a. Gloeolichens. Among crustaceous forms the thallus is generally elementary, more
especially in the Gloeolichens (Pyrenopsidaceae). The algae of that family,
Gloeocapsa, Xanthocapsa or Chroococcus, are furnished with broad gelatinous
sheaths which, in the lichenoid state, are penetrated and traversed by the fungal
filaments, a branch hypha generally touching with its tip the algal cell-wall. Under the
influence of symbiosis, the algal masses become firmer and more compact, without
much alteration in form; algae entirely free from hyphae are often intermingled with
the others. Even among Gloeolichens there are signs of advancing development both
in the internal structure and in outward form. Lobes free from the substratum,
though very minute, appear in the genus Paulia, the single species of which comes
from Polynesia. Much larger lobes are characteristic of Thyrea, a Mediterranean and
American genus. The fruticose type, with upright fronds of minute size, also appears
in our native genus Synalissa. It is still more marked in the coralloid thalli of Peccania
and Phleopeccania. In most of these genera there is also a distinct tendency to
differentiation of tissues, with the gonidia congregating towards the better lighted
surfaces. The only cortex formation occurs in the crustaceous genus Forssellia in
which, according to Zahlbruckner[1000], it is plectenchymatous above, the thallus
being attached below by hyphae penetrating the substratum. In another genus,
Anema[1001], which is minutely lobate-crustaceous, the internal hyphae form a
cellular network in which the algae are immeshed. As regards algal symbionts, the
members of this family are polyphyletic in origin.
b. Ephebaceae and Collemaceae. In Ephebaceae the algae are tufted and filamentous,
Scytonema, Stigonema or Rivularia, the trichomes of which are surrounded by a
common gelatinous sheath. The hyphae travel in the sheath alongside the cell-rows,
and the symbiotic plant retains the tufted form of the alga as in Lichina with
Rivularia, Leptogidium with Scytonema, and Ephebe with Stigonema. The last named
lichen forms a tangle of intricate branching filaments about an inch or more in
length. The fruticose habit in these plants is an algal characteristic; it has not been
acquired as a result of symbiosis, and does not signify any advance in evolution.
A plectenchymatous cortex marks some progress here also in Leptodendriscum,
Leptogidium and Polychidium, all of which are associated with Scytonema. These
genera may well be derived from an elementary form such as Thermutis. They differ
from each other in spore characters, etc., Polychidium being the most highly
developed with its cortex of two cell-rows and with two-celled spores.
Nostoc forms the gonidium of Collemaceae. In its free state it is extremely
gelatinous and transmits that character more or less to the lichen. In the crustaceous
genus Physma, which forms the base of the Collema group or phylum, there is but
little difference in form between the thalline warts of the lichen crust and the original
small Nostoc colonies such as are to be found on damp mosses, etc.
In Collema itself, the less advanced species are scarcely more than crusts, though
the more developed show considerable diversity of lobes, either short and pulpy, or
spreading out in a thin membrane. The Nostoc chains pervade the homoiomerous
thallus, but in some species they lie more towards the upper surface. There is no
cortex, though once and again plectenchyma appears in the apothecial margin, both
in this genus and in Leprocollema which is purely crustaceous.
Leptogium is a higher type than Collema, the thallus being distinguished by its
cellular cortex. The tips of the hyphae, lying close together at the surface, are cut off
by one or more septa, giving a one- or several-celled cortical layer. The species
though generally homoiomerous are of thinner texture and are less gelatinous than
those of Collema.
c. Pyrenidiaceae. This small family of pyrenocarpous Phycolichens may be
considered here though its affinity, through the form of the fruiting body, is with
Archilichens. The gonidia are species of Nostoc, Scytonema and Stigonema. There
are only five genera; one of these, Eolichen, contains three species, the others are
monotypic.
The crustaceous genera have a non-corticate thallus, but an advance to lobate
form takes place in Placothelium, an African genus. The two genera that show most
development are both British: Coriscium (Normandina), which is lobate,
heteromerous and corticate—though always sterile—and Pyrenidium which is
fruticose in habit; the latter is associated with Nostoc and forms a minute sward of
upright fronds, corticate all round; the perithecium is provided with an entire wall
and is immersed in the thallus.
If the thallus alone were under consideration these lichens would rank with
Pannariaceae.
d. Heppiaceae and Pannariaceae. The next stage in the development of Phycolichens
takes place through the algae, Scytonema and Nostoc, losing not only their
gelatinous sheaths, but also, to a large extent, their characteristic forms. Chains of
cells can frequently be observed, but accurate and certain identification of the algal
genus is only possible by making separate cultures of the gonidia.
Scytonema forms the gonidium of the squamulose Heppiaceae consisting of the
single genus Heppia. The ground tissue of the species is either wholly of
plectenchyma with algae in the interstices, or the centre is occupied by a narrow
medulla of loose filaments.
In the allied family Pannariaceae, a number of genera contain Scytonema or
Nostoc, while two, Psoroma and Psoromaria, have bright-green gonidia. The thallus
varies from crustaceous or minutely squamulose, to lobes of fair dimension in
Parmeliella and in Hydrothyria venosa, an aquatic lichen. Plectenchyma appears in
the upper cortex of both of these, and in the proper margin of the apothecia, while
the under surface is frequently provided with rhizoidal filaments.
These two families form a transition between the gelatinous, and mostly
homoiomerous thallus, and the more developed entirely heteromerous thallus of
much more advanced structure. The fructification in all of them, gelatinous and non-
gelatinous, is a more or less open apothecium, sometimes immarginate, and
biatorine or lecideine, but often, even in species nearly related to these, it is
lecanorine with a thalline amphithecium. Rarely are the sporiferous bodies sunk in
the tissue, with a pseudo-perithecium, as in Phylliscum. It would be difficult to trace
advance in all this group on the lines of fruit development. The two genera with
bright-green gonidia, Psoroma and Psoromaria, have been included in Pannariaceae
owing to the very close affinity of Psoroma hypnorum with Pannaria rubiginosa; they
are alike in every respect except in their gonidia. Psoromaria is exactly like Psoroma,
but with immarginate biatorine apothecia, representing therefore a lower
development in that respect.
These lichens not only mark the transition from gelatinous to non-gelatinous
forms, but in some of them there is an interchange of gonidia. The progression in
the phylum or phyla has evidently been from blue-green up to some highly evolved
forms with bright-green algae, though there may have been, at the beginning, a
substitution of blue-green in place of earlier bright-green algae, Phycolichens
usurping as it were the Archilichen condition.
e. Peltigeraceae and Stictaceae. The two families just examined marked a great
advance which culminated in the lobate aquatic lichen Hydrothyria. This lichen, as
Sturgis pointed out, shows affinity with other Pannariaceae in the structure of the
single large-celled cortical layer as well as with species of Nephroma (Peltigeraceae).
A still closer affinity may be traced with Peltigera in the presence in both plants of
veins on the under surface. The capacity of Peltigera species to grow in damp
situations may also be inherited from a form like the submerged Hydrothyria. In both
families there are transitions from blue-green to bright-green gonidia, or vice versa,
in related species. Thus in Peltigeraceae we find Peltigera containing Nostoc in the
gonidial zone, with Peltidea which may be regarded as a separate genus, or more
naturally as a section of Peltigera; it contains bright-green gonidia, but has
cephalodia containing Nostoc associated with its thallus.
The genus Nephroma is similarly divided into species with a bright-green gonidial
zone, chiefly Arctic or Antarctic in distribution, and species with Nostoc (subgenus
Nephromium) more numerous and more widely distributed.
Peltigera and Nephroma are also closely related in the character of the
fructification. It is a flat non-marginate disc borne on the edge of the thallus: in
Peltigera on the upper surface, in Nephroma on the under surface. The remaining
genus Solorina contains normally a layer of bright-green algae, but, along with these,
there are always present more or fewer Nostoc cells, either in a thin layer as in S.
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebookgate.com

More Related Content

PDF
Making use of Python 1st Edition Rashi Gupta
PDF
Python_Crash_Course_2nd_Edition.pdf
PDF
Python Programming A Stepbystep Guide To Learning The Language C K Dhaliwal
PPTX
Application development with Python - Desktop application
PDF
Python Cookbook 1st Edition Alex Martelli
PDF
The Python Workshop.pdf
PDF
Instant download Python Cookbook 1st Edition Alex Martelli pdf all chapter
PDF
Python Cookbook 1st Edition Martelli Alex Ascher David
Making use of Python 1st Edition Rashi Gupta
Python_Crash_Course_2nd_Edition.pdf
Python Programming A Stepbystep Guide To Learning The Language C K Dhaliwal
Application development with Python - Desktop application
Python Cookbook 1st Edition Alex Martelli
The Python Workshop.pdf
Instant download Python Cookbook 1st Edition Alex Martelli pdf all chapter
Python Cookbook 1st Edition Martelli Alex Ascher David

Similar to Making use of Python 1st Edition Rashi Gupta (20)

PDF
Python Cookbook 1st Edition Alex Martelli
PPTX
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
PDF
Class 12 Ip Whole Text Book Preeti Arora
PDF
Python for informatics
PDF
PDF
Introduction-To-Python- a guide to master
PDF
Tutor Py
PDF
Python Cookbook 1st Edition Alex Martelli
PDF
Exploratory Analytics in Python provided by EY.pdf
PPT
Master Python Basics Easily – From Zero to Real-World Applications for UG Stu...
PPTX
_python Raunak.pptx
PDF
Mastering the Interview: 50 Common Interview Questions Demystified
PPT
Input, Processing and Output
PDF
Python for Everybody
PPTX
Introduction-to-Python-Programming1.pptx
PDF
Python for everybody
PPTX
Austin Python Learners Meetup - Everything you need to know about programming...
PDF
Python-content-1.pdf
PDF
From Basics to Advanced: A Comprehensive Python Programming Guide
PDF
Python Essentials For Dummies John C Shovic Alan Simpson
Python Cookbook 1st Edition Alex Martelli
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
Class 12 Ip Whole Text Book Preeti Arora
Python for informatics
Introduction-To-Python- a guide to master
Tutor Py
Python Cookbook 1st Edition Alex Martelli
Exploratory Analytics in Python provided by EY.pdf
Master Python Basics Easily – From Zero to Real-World Applications for UG Stu...
_python Raunak.pptx
Mastering the Interview: 50 Common Interview Questions Demystified
Input, Processing and Output
Python for Everybody
Introduction-to-Python-Programming1.pptx
Python for everybody
Austin Python Learners Meetup - Everything you need to know about programming...
Python-content-1.pdf
From Basics to Advanced: A Comprehensive Python Programming Guide
Python Essentials For Dummies John C Shovic Alan Simpson
Ad

Recently uploaded (20)

PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Computing-Curriculum for Schools in Ghana
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Classroom Observation Tools for Teachers
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
master seminar digital applications in india
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
01-Introduction-to-Information-Management.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Basic Mud Logging Guide for educational purpose
Microbial diseases, their pathogenesis and prophylaxis
GDM (1) (1).pptx small presentation for students
Sports Quiz easy sports quiz sports quiz
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Final Presentation General Medicine 03-08-2024.pptx
Computing-Curriculum for Schools in Ghana
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Classroom Observation Tools for Teachers
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
master seminar digital applications in india
human mycosis Human fungal infections are called human mycosis..pptx
Renaissance Architecture: A Journey from Faith to Humanism
Anesthesia in Laparoscopic Surgery in India
01-Introduction-to-Information-Management.pdf
Ad

Making use of Python 1st Edition Rashi Gupta

  • 1. Making use of Python 1st Edition Rashi Gupta pdf download https://ebookgate.com/product/making-use-of-python-1st-edition- rashi-gupta/ Get Instant Ebook Downloads – Browse at https://ebookgate.com
  • 2. Instant digital products (PDF, ePub, MOBI) available Download now and explore formats that suit you... Rashi 1st Edition Avraham Grossman https://ebookgate.com/product/rashi-1st-edition-avraham-grossman/ Methamphetamine A Love Story 1st Edition Rashi K. Shukla https://ebookgate.com/product/methamphetamine-a-love-story-1st- edition-rashi-k-shukla/ Doing Math with Python Use Programming to Explore Algebra Statistics Calculus and More 1st Edition Amit Saha https://ebookgate.com/product/doing-math-with-python-use- programming-to-explore-algebra-statistics-calculus-and-more-1st- edition-amit-saha/ Clinical Atlas of Polysomnography 1st Edition Ravi Gupta https://ebookgate.com/product/clinical-atlas-of- polysomnography-1st-edition-ravi-gupta/
  • 3. Surgical Management of Vitiligo 1st Edition Somesh Gupta https://ebookgate.com/product/surgical-management-of- vitiligo-1st-edition-somesh-gupta/ Python Tricks A Buffet of Awesome Python Features Dan Bader https://ebookgate.com/product/python-tricks-a-buffet-of-awesome- python-features-dan-bader/ Extractive Metallurgy of Rare Earths 1st Edition C.K. Gupta https://ebookgate.com/product/extractive-metallurgy-of-rare- earths-1st-edition-c-k-gupta/ Learning BeagleBone Python Programming Unleash the potential of BeagleBone using Python 1st Edition Hiam https://ebookgate.com/product/learning-beaglebone-python- programming-unleash-the-potential-of-beaglebone-using-python-1st- edition-hiam/ Biotechnology of Fungal Genes 1st Edition V. K. Gupta (Editor) https://ebookgate.com/product/biotechnology-of-fungal-genes-1st- edition-v-k-gupta-editor/
  • 5. Making Use of Python
  • 7. Wiley Publishing, Inc. Rashi Gupta Making Use of Python
  • 8. Publisher: Robert Ipsen Editor: Ben Ryan Managing Editor: Angela Smith New Media Editor: Brian Snapp Text Design & Composition: John Wiley Composition Services Designations used by companies to distinguish their products are often claimed as trade- marks. In all instances where John Wiley & Sons, Inc., is aware of a claim, the product names appear in initial capital or ALL CAPITAL LETTERS. Readers, however, should contact the appro- priate companies for more complete information regarding trademarks and registration. This book is printed on acid-free paper. ∞ Copyright © 2002 by Rashi Gupta. All rights reserved. Published by Wiley Publishing, Inc., New York. Published simultaneously in Canada. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copy- right Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA01923, (978) 750-8400, fax (978) 750-4744. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 605 Third Avenue, New York, NY 10158-0012, (212) 850-6011, fax (212) 850-6008, E-Mail: PERMREQ @ WILEY.COM. This publication is designed to provide accurate and authoritative information in regard to the subject matter covered. It is sold with the understanding that the publisher is not engaged in professional services. If professional advice or other expert assistance is required, the services of a competent professional person should be sought. Library of Congress Cataloging-in-Publication Data: ISBN: 0471-21975-4 Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. Printed in the United States of America. 10 9 8 7 6 5 4 3 2 1
  • 9. Introduction xi Scenario xxiii Chapter 1 An Introduction to Python 1 Getting Started 1 Understanding Requirements 2 Determine Requirements of the University 2 Obtain Python and Its Documentation 3 Determine the System Requirements 4 Install Python 5 Start Python in Different Execution Modes 7 Summary 12 Chapter 2 Getting Started with Python 13 Getting Started 14 Writing Your First Python Program 14 Comments 15 Python as a Calculator 16 Using Variables in Python 16 Variables 17 Assigning Values to Variables 18 Standard Types 19 Identifiers and Keywords 39 Memory Management 40 Create a Sequence to Store All the Names of the Students 42 Write the Code to Display the Names of the Students 42 Contents v
  • 10. Declare a Dictionary of Student Purchases with the Names of the Students as the Key 43 Write the Code to Display the Student Purchases 43 Save and Execute the Code 43 Verify the Details 44 Summary 44 Chapter 3 Intrinsic Operations and Input/Output 47 Getting Started 48 Using Input/Output Features and Intrinsic Operations for Data Types in Python 48 Identify the Variables to Be Used 49 Accepting User Input 49 Formatting the Output 50 Introduction to Intrinsic Operations 55 Intrinsic Operations for Numeric Data Types 57 Intrinsic Operations for Strings 60 Intrinsic Operations for Lists and Tuples 66 Write the Code 71 Execute the Code 71 Summary 73 Chapter 4 Programming Basics 75 Getting Started 76 Conditional Operators 76 Order of Precedence of Operators 82 Using Programming Constructs 83 Identify the Control and Loop Statements to Be Used 84 Write the Code 94 Execute the Code 95 Summary 97 Chapter 5 Functions 99 Getting Started 100 Using Functions 100 Functions 101 Scope of Variables 118 Identify the Functions to Be Used 119 Write the Code 119 Execute the Code 121 Summary 122 Chapter 6 Modules 123 Getting Started 124 Using Modules 124 Modules 124 Packages 135 Identify the Modules to Be Used 136 vi Contents
  • 11. Write the Code 137 Execute the Code 139 Summary 140 Chapter 7 Files 141 Getting Started 141 Using File Objects 142 Identify the Functions and Methods to Be Used 142 Write the Code to Store Course Details to the File 154 Execute the Code 155 Verify the Solution 155 Summary 156 Chapter 8 Object-Oriented Programming 157 Getting Started 158 Introducing OOP 158 Components of OOP 159 Benefits of OOP 160 Using Classes 161 Identify the Classes to Be Defined 162 Identifying the Class Objects 163 Identifying the Classes to Be Inherited and Their Objects 170 Identify the Methods to Be Overridden 173 Write the Code 182 Execute the Code 189 Summary 190 Chapter 9 Exception Handling 193 Getting Started 193 Handling Exceptions 194 Identify the Type of Error and Where the Error Occurs 196 Identify the Mechanism of Trapping the Exception 200 Identify the Location for the Code for Handling the Exception to Be Written 209 Write the Code for Handling the Exception 209 Save and Execute the Code 210 Summary 210 Chapter 10 CGI Programming 213 Getting Started 213 Internet Basics 214 World Wide Web 217 Web Browsers 217 Hypertext Transfer Protocol (HTTP) 220 Revising HTML 221 Client-Side versus Server-Side Scripting 227 An Introduction to CGI 229 Contents vii
  • 12. Writing CGI Applications 231 Write the Code for the HTML Form to Accept Data from the User 231 Write the CGI Program in Python to Generate the Results Page 232 Write the CGI Program to Generate Both the Form and Results Pages 236 Execute the Code 237 Summary 239 Chapter 11 Database Programming 241 Getting Started 241 Database Management 242 Introduction to MySQL 243 Working with MySQL 246 Accessing a Database from a Python Script 254 Identify the Elements of the Table That Stores Registration Details 256 Identify the Steps for Connecting to the Database 256 Write the Code to Create a Table in the Database 259 Write the Code to Insert the Registration Details into the Table Created 260 Execute the Code to Create the Table in the Database 261 Execute the Code to Insert Data into the Table 261 Verify the Data in the Database 263 Summary 264 Chapter 12 Network Programming 267 Getting Started 267 Client/Server Architecture 268 Network Programming 269 Using Sockets 272 Identify the Sockets to Be Used 272 Write the Code to Run on the IT Department Computer 287 Write the Code to Run on the Admission Office Computer 288 Execute the Code Created for the IT Department Computer 289 Execute the Code Created for the Admission Office Computer 290 Verify that Data Has Been Saved to a File in the IT Department Computer 292 Summary 292 Chapter 13 Multithreaded Programming 297 Getting Started 297 Single-Threaded Applications 298 Threading in Python 299 viii Contents
  • 13. Creating Multithreaded Applications 300 Identify the Class and the Methods to Create a Multithreaded Application 300 Write Code for the Server 308 Write the Code for the Client 309 Execute the Code Created for the Server 310 Execute the Code Created for the Client 311 Summary 313 Chapter 14 Advanced Web Programming 315 Getting Started 316 Creating Web Servers 316 Accessing URLs 323 Creating Advanced CGI Applications 328 Identify the Elements of the Web Page for Entering Assignment Details and Uploading the File 328 Identify the Methodology for Uploading the File 329 Identify the Methodology for Storing User Information 330 Write the Code for the CGI Script 335 Execute the CGI Script 339 Summary 340 Chapter 15 GUI Programming with Tkinter 343 Getting Started 343 Introduction to Tkinter 344 Creating a GUI Application 347 Identify the Components of the User Interface 348 Identify the Tkinter Widgets to Design the User Interface 348 Write the Code for the User Interface 360 Execute the Code 362 Summary 364 Appendix A Distributing COM Objects 365 Basics of COM 365 The Binary Standard 367 COM Interfaces 369 Binding 370 Python and COM 371 Creating COM Clients 371 Creating COM Servers 373 Index 377 Contents ix
  • 15. In this competitive age, high productivity, tight deadlines, and short development cycles are the buzzwords in the application development world. These are the reasons why software developers prefer rapid application development (RAD) tools like Python. Python is a portable, interpreted, object-oriented programming language. It com- bines remarkable power with very clear syntax. Moreover, its high-level built-in data structures, combined with dynamic typing and dynamic binding, make it very attrac- tive for rapid application development. Python is being used successfully to glue together large software components. It spans multiple platforms, middleware products, and application domains. Python has been around since 1991, and it has a very active user community. Python can fulfill an important integration role in the design of large applications with a long life expectancy. It allows a fast response to changes in user requirements that require adapting the higher-level application logic without changing the fundamental underlying components. It also allows quick adaptation of the application to changes in the under- lying components. Guido van Rossum, CNRI Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms. www.python.org This book is an attempt to bridge the ever-increasing gap between the market demand and the availability of Python expertise. The first step to becoming an expert is acquiring an in-depth knowledge of Python, and that is exactly what this book has to offer. It begins with the basics of scripting and seamlessly moves to programming intricacies. Introduction xi
  • 16. Along with conceptual information this book will also provide extensive practical exercises for the reader to gain valuable, real-life exposure to creating different types of applications. Overview of Python Python is a free, open-source, general-purpose, interpreted, and powerful scripting language for Web applications. It is an easy yet powerful programming language that provides structure and support for large applications as well as the power and com- plexity of traditional high-level languages. Python is the ideal choice if you require a single language with the features of both an interpreted and a scripting language. History of Python Python is directly derived from the scripting language ABC, which was mainly used for teaching purposes in the 1980s by a small number of people. Python’s development was triggered by the need to develop tools to automate monotonous and time- consuming tasks. Guido van Rossum is the creator of Python. He started work on Python in late 1989 at CWI in Amsterdam. When Guido started work on Python, he was a researcher at CWI. Initially, Python was designed to perform general administration tasks. Later, it became a part of the Amoeba project at CWI and was first released for public use in February 1991. A large part of Python development occurred at CNRI in Reston, Vir- ginia, in the United States. In June 2000, the Python development team moved to Pythonlabs, a member organization of the BeOpen network. The lead developers of Python, including Guido van Rossum, maintained Pythonlabs. In October 2000, the lead developers left BeOpen.com and joined Digital Creations. Since then the team has been involved in Python development. Any intellectual property that is added to Python is taken care by a nonprofit organization called Python Software Foundation. Features of Python Python can act as a connecting language that links many separate software compo- nents in a simple and flexible manner. It can also act as a guiding language in which high-level Python modules control low-level operations implemented by libraries in other languages. Due to its ease of learning and strength to develop large applications, it can serve both as a learner’s first programming language and as an interface for users who want to become experts in advanced application development. Let’s discuss some of the salient features of Python. Easy Python has an easy syntax, clean and simple semantics, and relatively few keywords, which allow a new developer to learn Python very quickly and easily. It will require a lesser effort for people who have some programming knowledge. Python has a syntax xii Introduction
  • 17. that is similar to that of Algol, C, and Pascal. In fact, it is a simplification of these lan- guages and does not require any extra effort to learn an unfamiliar concept, syntax, or keywords. Python is an object-oriented programming (OOP) language, but unlike C++, OOP is not a mandatory concept for Python. You can start learning Python and learn about OOP at a convenient point. Moreover, Python does not have extra symbols for starting and ending code blocks, defining an end to a statement, and pattern matching. Symbols such as curly braces ({}), dollar signs ($), semicolons (;), tildes (~), and at symbols (@), which are part and parcel of many programming languages, do not constrain code written in Python. Indentation is used to group statements to form code blocks. Therefore, you are less likely to have bugs in your code due to incorrect indentations. Python is so simple to understand that a reader who has never seen a single line of code can understand a basic code written in Python. Scalable Unix shell scripting languages are fairly easy and can handle simple tasks very easily and efficiently. When you add more features to a script, however, the script becomes very large, complicated, and slow. You are unable to reuse your code, and even small projects require huge scripts. Python provides a better structure and support for large programs than shell scripting. You can build on your code from one project to another or plug or create new components by reusing the existing code. The term “scalability” in relation to Python refers to Python’s capability to provide ingredients to build an application and to provide pluggable and modular architecture for the applications that need to incorporate more functionality. Python allows you to split your script into modules and reuse these modules in other Python programs. Many standard modules, which can be used based on the requirements of the program, are also built into Python. Many built-in modules aid you in input/output, system calls, socket programming, and GUI programming, such as Tkinter. High Level Consider that you have a shell script and you want to add a feature to it. It is possible that the feature involves a system call, variable-length strings, or other data types that are easy to implement in shell but will involve long code passages in C. Perhaps you are not adequately familiar with C to write complex code. Python takes care of all these issues. Python has built-in modules that help you make system calls. Useful, high-level data types, such as lists (resizable arrays) and dictionaries (hash tables) are built into Python, allowing you to express complicated expressions in a single statement. No variable or argument declaration is necessary.After a value is assigned to a name, Python instantly assumes the required type. All this minimizes the time and effort required to implement a particular functionality in a program. The data types also reduce the code size, resulting in a more comprehensible code. On the other hand, these data types would be difficult to implement in C due to the required use of data structures and pointers and the repetitive code needed to implement every large application. Introduction xiii
  • 18. Object Oriented As stated earlier, OOP is a concept that is not imposed in Python right from the begin- ning. Nonetheless, Python is a truly object-oriented language and provides features of other structured and procedural languages. All components in Python are objects. Python allows object orientation with multiple inheritance and late binding. You can create object-oriented class hierarchies, and every attribute is referred to in name. attribute notation. In this notation, an attribute is determined dynamically at run time. Python also supports polymorphism—that is, Python callable objects can accept optional arguments, keyword arguments, or an unlimited number of arguments. The same operator can have different meanings according to the elements being refer- enced. These features allow complex operations to be implemented in small Python declarations. The source code of Python is also object oriented. Interpreted Python is an interpreted language that supports byte compilation. Python programs can be run, debugged, and tested interactively by the Python interpreter, which runs in interactive mode. In traditional interpreted languages, execution does not take place in the native binary language of a system. Therefore, execution in traditional interpreted languages is slower compared to that of compiled languages. Python’s source code is byte-compiled directly when it is loaded on the interpreter, or it can be explicitly byte- compiled. In addition, byte code of Python is machine independent and can be exe- cuted on different hardware and software platforms without compiling it again. Therefore, Python is an intermediate form providing features of both compiled and interpreted languages. Let’s discuss in detail why Python is considered an interpreted language. Python programs can be executed at the interpreter in command-line mode and script mode. In command-line mode, you type Python statements, and the interpreter prints the result. $ python Python 2.2a4 (#2, Nov 2 2001, 11:00:25) GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on Linux2 Type “help”,”copyright”, “credits” or “license” for more information. >>> print 1 + 1 2 The first line of this example is the command that starts the Python interpreter. The next two lines are messages that are displayed by the interpreter. The third line begins with three greater-than signs (“>>>”), which is the prompt used by the interpreter to indicate that it is ready. This is also the interpreter’s primary prompt. Typing 1 + 1 at the interpreter returns 2 as the result in the next line. If your code has a multiline construct, the interpreter prompts with a secondary prompt, which is three dots (“...”) by default. Consider the following example: >>> i=1 >>> if i is 1: xiv Introduction
  • 19. ... print 1+1 2 Alternatively, you can write a program in a file and use the interpreter to execute the contents of the file. Such a file written in Python is called a script. For example, a text editor can be used to write a file, calculate.py, with the following contents: print 1 + 1 By convention, files that contain Python programs have names with the .py extension. To execute the program, you need to specify the name of the script at the interpreter. $ python calculate.py 2 Extensible and Flexible An application that contains a large amount of code can be effectively organized into smaller modules due to Python’s dual structured and object-oriented programming environments. These modules can still interact with each other or with other built-in modules. Python’s syntax is the same for accessing both the user-defined and the built- in standard modules. Python is also extremely flexible in the treatment of language components. For example, a Python module that is meant to interact with the external environment can be tested using an imitation of the external environment written in Python. Rich Core Library Many development modules are built into Python and are part of the Python Standard Library. A programmer can make use of these tools in the Python Standard Library, depending on the application for which the tools are required. Besides modules that work on all platforms, the library has modules that are specific to a particular platform or environment. Python standard modules perform all types of usual tasks, such as HTTP, FTP, POP, SMTP, and many other services. Using the rich core library, you can write applications for downloading a Web page, parsing HTML files, developing a graphic user interface (GUI), and so on. Memory Management C and C++ programmers always need to write code for handling memory manage- ment and memory modification even if the program has very little to do with memory access. This always results in an extra burden on the programmer. One clear example is the need for tracking each object and deleting the reserved memory once the object ends its life. This is the responsibility of the developer, and any failure can lead to Introduction xv
  • 20. memory leaks and other negative consequences. In Python, the interpreter manages memory, thus removing the extra burden on the programmer. This results in fewer errors and a more efficient application involving less development time. Web Scripting Support and Data Handling Python is popularly used for developing Internet and intranet applications. Python is well suited for Internet and intranet applications because these applications are highly dynamic and complex, and at times, they need to interact with several environments. Python’s dynamism, the ease with which you can write complex applications, and its advanced features, such as HTML, XML, and SGML parsing, allow you to write CGI scripts for several environments. Object Distribution You can use Python to implement routines that can communicate with objects in other languages. For example, Python can be used to pass data to COM components. In addition, Common Object Request Broker Architecture (CORBA) can be implemented in Python as well, which enables you to use cross-platform distributed objects. Databases Python provides interfaces to all major commercial databases. Besides that, it has built- in modules that enable you to handle flat file databases. It also has object persistence systems that can write entire objects to files. Python’s most important database- programming feature, though, is Python API. This API includes functions that make it easy to write applications that communicate with different databases. GUI Programming Python supports GUI applications that can be created and ported to many system calls, libraries, and windows systems, such as Windows MFC, Macintosh, and the X Window system of Unix. This is possible using Python’s default graphic user interface library, Tkinter. Tkinter is the standard object-oriented interface of the TK GUI API, which is the official GUI development platform of Python. Extendable and Embeddable You can add low-level modules to the Python interpreter. These modules enable pro- grammers to add to or customize their tools to be more efficient. Compiled extension modules can be created in Python to connect Python modules with external program- ming libraries or new data types. Extension modules are easily created and maintained using Python. Most platforms support the loading of new compiled components into the interpreter dynamically. Python extension modules can be written in C and C++ for CPython and in Java for JPython. xvi Introduction
  • 21. The Python interpreter can be embedded into another programming or scripting application. Any other program can use the Python interpreter as a simple application program interface (API). Therefore, the Python interpreter can act as a scripting tool that glues everything. Exception Handling When running a program, if Python exits due to an error, it generates a complete stack trace of errors. This stack trace indicates the name and type of the error that occurred. The exception handling in Python allows you to detect errors at run time without adding error-checking statements to your code. Exception handlers can be written in Python to defuse a problem, perform a clean-up or maintenance action, or redirect the program flow. This allows a programmer to put in considerably less effort to debug an error. Portable Python can run on a wide variety of hardware platforms and has the same interface on all platforms. Its design is not linked to a particular operating system because it is writ- ten in portable ANSI C. This means that you can write, test, and upload a program written in Python on Windows, Linux, and Macintosh environments. This depends on whether the application is developed to implement specific commands of an operating system or if the application uses modules that do not work on all platforms. In these situations, the application cannot run on all hardware platforms; however, this affects only a few modules. Usually, the applications that you create run on all the platforms without changing any code. Freeware Python is freeware and can be redistributed freely in the source form. The copyright of Python does not allow authors to place it at risk legally and does prevent users from hijacking its copyright. Programmers and users are allowed to use Python’s source in any desired way. Programmers can create applications and release them in the binary- only form, which has modules in only the byte-compiled form. The result of the prod- uct can, however, be sold or distributed in any manner. Users and Application Areas of Python Python is an advanced scripting language that is being used in various areas. Some of the areas where Python is being used are the following: ■ ■ Gluing together large software components. These large software components can be written in C, C++, or Java. ■ ■ Creating prototypes of an application. The prototype can be written in Python without writing any C, C++, or Java code. Often, the prototype is sufficiently functional and performs well enough to be delivered as the final product, sav- ing considerable development time. Introduction xvii
  • 22. ■ ■ Writing CGI scripts on all platforms (Unix, Windows, and Mac). Because of this ability Python has a strong presence on the Web. Besides these, Python is also well represented in the distributed systems world. It is one of the main languages supported by Xerox PARC’s ILU. It has also been used to implement the Web browser Grail. A list of Python users worldwide include the following: ■ ■ NASA ■ ■ Infoseek ■ ■ Digital Creations ■ ■ Grail ■ ■ Xerox ■ ■ Hewlett-Packard ■ ■ CMU ■ ■ Digital Media Inc. ■ ■ University of Queensland, Australia ■ ■ Space Telescope Science Institute ■ ■ Mind Spring ■ ■ Mitretek Systems Python versus Other Languages It is a well-known fact that scripting languages are slower than compiled languages. The Python interpreter carries out most of the tasks that are carried out by a compiler in all compiled languages. at Python, however, is an intermediate language that pro- vides the features of both compiled and interpreted languages. Python can be com- pared with many other languages mainly because it provides many salient features in other languages and is derived from many languages, such as C, C++, Modula-3, ABC, SmallTalk, and Unix shell. Python is often compared with C and C++ because it has syntax similar to the syn- tax of these languages. Python is considered a good tool to test C and C++ applications. It also glues some components of C/C++ contributing to C/C++ projects. In many ways, Python has merits over C/C++. Memory allocation and reference errors that occur in C/C++ are eliminated by the Python interpreter, which performs automatic memory management. Python code is usually easier and smaller than that in C and C++. Python’s array constructs generate fewer problems than the array constructs of C and C++. Perl is another scripting language that you can compare with Python. Like Python, Perl is of great use to programmers and system administrators. Perl is also a powerful language for text manipulation and data extraction. Unlike Python, though, Perl has a difficult syntax that dissuades beginners from learning it. Perl is a popular language xviii Introduction
  • 23. used to develop Common Gateway Interface (CGI) scripts for Internet programming. Programmers working on the same large project find it difficult to understand each other’s code because there are many ways of writing a program. Tcl is also one of the popular scripting languages. Python is compared with Tcl for many reasons. Tcl is a powerful and easy scripting language that provides the features of a programming language as well as tools for system calls. Tcl is a more restrictive language than Python because it has fewer data types than Python. Python uses the same toolkit, Tk, as Tcl for developing GUI applications. Python uses the OOP concept and has syntax similar to that of Java. Unlike Python, Java applications require huge code and a compilation phase. Moreover, Python offers dynamic typing and a rapid development environment. Python, though, is slower and less portable than Java. A breakthrough in the relationship of Python and Java is JPython, a Python interpreter that is constructed completely in Java. It can run on any machine containing Java Virtual Machine (JVM). It provides programmers with the features of Python along with a hoard of Java classes. A complete discussion on JPython is out of the scope of this book. Some of its salient features are as follows: ■ ■ JPython provides a scripting environment for Java development. ■ ■ JPython generates a truly object-oriented programming environment. ■ ■ An application written in JPython can access Java classes directly and can inte- grate them with its own JPython classes, whenever required. ■ ■ JPython provides access to Java AWT/Swing libraries for GUI development. ■ ■ Compiled JPython programs create Java byte code, creating a .class file, which can be used to create applets. How This Book Is Organized This book shrugs away from the traditional content-based approach and uses the problem-based approach to present the concepts of Python. Problems used in the book are presented against the backdrop of real-life scenarios. The problem is followed by a task list that helps to solve that problem, in the process delivering the concepts and their implementation. This practical approach will help readers to understand the real- life application of the language and its use in various scenarios. Moreover, to provide an appropriate learning experience, the concepts will be supported adequately by case studies that will be formulated in such a way that they provide a frame of reference for the reader. Chapter 1 is a guide to obtaining the Python software and its documentation. It also discusses installation of Python on Unix, Linux, and Windows systems. Finally. it dis- cusses the execution modes of Python and starting Python in Unix, Linux, and Windows. Chapter 2 is a getting-started guide. It leads into developing a simple Python program. Then, it discusses the standard data types, type operators, and expressions. Finally, it mentions the identifiers and keywords in Python. Introduction xix
  • 24. Chapter 3 introduces intrinsic operations and input/output. It discusses formatting the output to enhance its visual appeal. It further discusses the built-in functions to use with each data type. Chapter 4 introduces programming constructs. It discusses using conditional constructs if...else, elif, and nested if constructs. It moves on to discuss loop constructs while and for. Finally, it discusses break, continue, and pass state- ments, which are used in loop constructs. Chapter 5 moves a step further and discusses about functions. It also discusses user- defined functions, Then, it talks about passing functions as arguments and returning values from functions. Finally, it discusses the built-in functions apply(), filter(), and map(). Chapter 6 discusses organizing code in Python modules. It also delves into importing data from modules into the programming environment. Finally, it discusses organizing modules into packages. Chapter 7 introduces using files in Python. It discusses writing and appending data to a file. It also discusses how to use Python to read the contents of a file. Chapter 8 delves into the all-important concept of object-oriented programming. It discusses classes and class objects in Python. Then, it discusses implementing classes. Finally, it talks about using inheritance, overriding methods, and using wrapping. Chapter 9 explains exceptions and the phases in which the actions related to an exception are performed. Next, it mentions the standard exceptions in Python. It fur- ther explains how exceptions can be raised. Finally, the chapter closes by explaining user-defined exceptions. Chapter 10 moves a few steps further and introduces CGI programming. This chapter assumes that the reader has understands basic Internet concepts and knows how to create Web pages and forms using HTML. For those who are new to the Internet, the chapter briefly recaps World Wide Web, HTTP requests, and HTML form elements and tags. The chapter then differentiates between client-side and server-side scripting. It finally dis- cusses the cgi module and generating dynamic Web pages by using a CGI application. Chapter 11 assumes the reader has basic knowledge about databases, data storage in databases, RDBMS concepts, and their implementation in MySQL. For those who are new to MySQL, this chapter details concepts about installing MySQL and working with the databases and tables in MySQL. It also discusses the Python Database API. Next, the chapter explains the processes of accessing and manipulating a MySQL data- base by using Python commands. Finally, the chapter discusses concepts such as the creation of a database table to store information and the use of query statements to access and manipulate data. Chapter 12 delves into network programming in Python by using sockets. It dis- cusses client/server architecture, protocols, sockets, IP addresses, and ports. It then dis- cusses using the socket to create a TCP server, TCP client, UDP server, and UDP client. Chapter 13 introduces another extremely important concept of multithreaded pro- gramming. The chapter begins by differentiating between a single-threaded application and a multithreaded application. It then discusses the thread module to create threads. Finally it discusses the threading module to create multithreaded applications. Chapter 14 further discusses advanced Web programming concepts. To start with, this chapter discusses how to create a Web server. Next, it talks about how to work xx Introduction
  • 25. with URLs by using Python. Finally, this chapter explains advanced CGI to generate dynamic Web pages using cookies and uploading files across an HTTP connection. Chapter 15 delves into developing user-friendly graphic interfaces. This chapter discusses using Tkinter, the official GUI framework for Python, to create GUI applica- tions. It mentions the various controls that can be included in a GUI interface. Finally, it leads to designing a GUI application. Finally, the appendix gives a brief introduction to Component Object Model (COM). It mentions the basics of COM and the support for COM in Python. Who Should Read This Book This book will be a guide for readers with a basic knowledge of programming. For those with an intermediate knowledge of Python, the book covers the advanced concepts of Python, too. This book will be of great help to people with the following job titles: ■ ■ Software engineers ■ ■ Web application developers ■ ■ Information application developers The book will provide the necessary skills to create GUI, networking, and Web applications. It will also talk about extending and embedding Python applications. Tools You Will Need For performing the tasks in this book, you will need a Pentium 200 MHz computer with a minimum of 64MB RAM (128MB RAM recommended). You will also need the following software: ■ ■ Operating system: Linux 7.1 or Windows 2000 Server ■ ■ Web server: Apache 1.3.19-5 (on Linux) and IIS 5.0 (on Windows) ■ ■ Relational database management system (RDBMS): MySQL 3.23.36-1 ■ ■ GNU C++ for Windows 2000 ■ ■ Python 2.2 What’s on the Web Site The following will be available on the site www.wiley.com/compbooks/makinguse: ■ ■ Python 2.2 ■ ■ All the code snippets used in the book Introduction xxi
  • 27. All problem statements in this book are based on the scenario of the Techsity University. The following section elaborates on the setup of Techsity University and the univer- sity’s future plans. Techsity University The term instructor-led training (ILT) implies that the real strength of the training depends on the instructor and the type of concept insight, knowledge, flexibility, and leadership an instructor can provide through the training. ILT is a form of traditional classroom learning methodology where students can ask questions, seek clarifications, and work directly in coordination with a knowledgeable instructor so as to fully under- stand concepts and terminology. This was the idea that led to the inception of Techsity University in January 1999. Techsity University started its operations with 50 students and 4 trainers at its center located in New York City. A total commitment to quality in terms of student satisfaction enabled Techsity University to earn a profit of $1 million in the very first year of its oper- ation. As an outcome of student responses to the courses offered, student enrollment and staff recruitment in Techsity University increased over the past three years. Currently, Techsity University provides 50 instructor-led courses, which include soft skills development courses and technical courses. Currently, the university offers these courses in five cities in different states of the United States; however, only four courses are available at any given time. At present, Techsity University offers regular as well as part-time courses. Scenario xxiii
  • 28. The five cities in which the Techsity University has centers are these: ■ ■ New York ■ ■ Los Angeles ■ ■ Chicago ■ ■ Denver ■ ■ Washington, D.C. The courses offered by Techsity University can be classified in the following categories: ■ ■ Business development ■ ■ Professional development ■ ■ Information technology ■ ■ Software ■ ■ Desktop technologies Course Structure Usually, the duration of the courses offered by the Techsity University varies from three to four weeks. Details about each course, such as fees, the syllabus, and the class structure, are available at the front office of each University location. Typically, a course comprises a beginner, an intermediate, and an advanced level. A student may choose to start from any of the three levels. If a student chooses to start a course from the inter- mediate or advanced levels, the student is interviewed at the beginning of the course. In addition, the student needs to take an entry-level test so that the authorities can determine whether the student meets the course prerequisites. Therefore, a student can join a course a level or two above the beginner’s level only after clearing the test and the interview. The schedule of regular courses consists of a five-hour class from Monday to Friday. Not all courses are offered as part time. The part-time courses have five-hour classes on weekends and two-hour classes on two chosen days of the week. Course objectives, syllabi, and any preliminary reading assignments are given to stu- dents before the start of the course. Depending on the type of course, the course structure comprises theoretical classes and hands-on practice classes. To increase the effectiveness of courses, a class may also contain an amalgamation of both theory and practice. Fee Structure The University has a flexible and moderate fee structure for the convenience of its stu- dents. A student can choose to pay the entire fee at the time of enrollment or pay the fee amount in installments. When paying in installments, a student has to pay 50 percent of the fees as down payment, 25 percent after the completion of 25 percent of the course, and the remaining 25 percent after completion of 75 percent the course. xxiv Scenario
  • 29. Future Direction As the number of students approaching the University for enrollment is increasing, it is considering offering its courses on the Web as well. The main reasons for such a con- sideration are as follows: ■ ■ Accommodating ILT in a student’s schedule means rearranging the student’s life around training rather than arranging training around the student’s life. ■ ■ Because ILT relies so severely on the instructors, a bad instructor can negate all the advantages associated with ILT. ■ ■ For the employed, attending ILT means time away from the office and involves additional costs for travel, lodging, meals and so forth. ■ ■ ILT is conducted at a speed dictated by the training material, the time allotted to the class, and the instructor’s approach to the training material. Students who do not fit the knowledge base or the understanding of the intended target audience in the class may find an ILT class a frustrating experience. A good instructor will tune the presentation to make it applicable to the widest range of classroom audience. Keeping these points in mind, Techsity University plans to gradually launch its con- tent on the Web. The Techsity University Web site planned to be developed soon will not only offer its Web-based courses but also promote instructor-led training, which forms the backbone of the courses it offers. The Web site will also provide support to students, such as providing experts to answer students’ queries and accepting and evaluating student assignments online. Scenario xxv
  • 31. C HAPTE R 1 C HAPTE R OBJECTIVES: In this chapter, you will learn to do the following: Identify the scenarios where Python can be used Obtain Python and its documentation Examine system requirements Install Python Start Python in different execution modes Getting Started The Introduction familiarized you with Python. It discussed what Python is, its history, and its key features. This chapter will discuss the locations from where Python can be obtained. You will also learn how to install Python on the various platforms and the various ways in which a Python program can be executed. At the end, you will learn about the Web sites from which Python documentation can be obtained. An Introduction to Python C HAPTE R 1
  • 32. Understanding Requirements Problem Statement Techsity University has been set up recently and currently does not have an online site. The University plans to expand its activities in the field of online training courses so that students from all over the United States can enroll for courses. Techsity wants a Web site that will enable learners to obtain information about its courses at the touch of a key. The Web site should be fast to code, scalable, and robust. Techsity has an application for internal use that was developed using C and C++. It wants to reuse as much of this application as possible to reduce development time for the new application. The new application needs to be developed within three months by using the existing team of C and C++ developers. Techsity’s Chief Technology Officer (CTO) has recommended Python as the new language because it meets all the requirements of the new application and because the existing team will be able to learn the new language easily, thus reducing the learning and development time. The CTO has assigned the task of understanding system requirements, obtaining Python for the development team, and getting Python run- ning to Jim. Task List Determine requirements of the University. Download Python and its documentation. Determine the system requirements. Install Python. Start Python in different execution modes. Determine Requirements of the University Before deciding on the software application and hardware platforms to use for the pre- vious scenario, let’s understand the requirements of the University (see Table 1.1). Obtain Python and Its Documentation Python is currently available in five stable versions. Python 1.5.2 was released in April 1999. Python 1.6 was made available to the public in September 2000 and has major new features and enhancements over Python 1.5.2. Python 2.0, released in October 2000, was more of a transition from Python 1.6. Python 2.1.1, released in July 2001, was mainly a bug fix release for Python 2.1. The final release of the latest version, Python 2.2, was released in December 2001. This book was developed when Python 2.2 was in its alpha release 4. Therefore, most of the screen shots in this book are taken in Python 2.2a4. 2 Chapter 1
  • 33. Table 1.1 Requirements of Techsity University REQUIREMENT DESCRIPTION Development time The entire application needs to be developed in three months. Platform The customers and dealers should be able to use any kind of operating system platform; that is, the application should be platform independent. Speed Techsity wants a computerized system that enables learners and dealers to obtain information about its products and schemes readily. Accessibility The University wants an information system that will enable individuals from any part of the United States to receive help on the courses and schemes offered by Techsity. Association The system should allow extension and embedding of C and C++ to make use of existing applications in these languages. Other features The CTO wants the application to be powerful, robust, and scalable. How to decide on the version? The code written in Python 1.5.2 is backward compatible with older versions and is available on the largest number of platforms. Python 2.0 has new features, such as Unicode support, but does not support backward compatibility. Programmers who are migrating from Python 1.5.2 to 2.0 can use Python 1.6. Programmers looking for improved features, such as Python’s model of objects and classes, improved multiple inheritance, new iteration interface, and new and improved modules, should use Python 2.2. You can find all the latest information about Python on the Python official Web site or the Pythonlabs Web site. The links are as follows: http://www.python.org (Community home page) http://www.pythonlabs.com (Commercial home page) Python is freeware; therefore, all of Python’s current software versions are available for free on the sites listed previously. You can download the Python distribution for Unix, Windows, and Mac systems from the link www.python.org/download. In addi- tion, Python documentation, news, and more are also available on this site. You can download the Python documentation from www.python.org/doc/. The documenta- tion is available in HTML, PDF, and PostScript formats. A part of the documentation is An Introduction to Python 3
  • 34. also available with the software package. The Python 2.2 distribution is a part of the following documentation that helps you learn Python and its advanced features: ■ ■ The Python Tutorial ■ ■ Global Module Index ■ ■ Library Reference ■ ■ Macintosh Module Reference ■ ■ Installing Python Modules ■ ■ Language Reference ■ ■ Extending and Embedding ■ ■ Python/C API ■ ■ Documenting Python ■ ■ Distributing Python Modules NOTE If you do not have Internet connectivity, all the versions of Python are available on the Web site for this book, www.wiley.com/compbooks/gupta. Determine the System Requirements As discussed earlier, Python is available on a wide variety of platforms, such as Unix, Windows, Macintosh, X Windows, OS/2, Be-OS, VMS, and Amiga. Python is supported by most of the platforms that have a C compiler. After you download your version of Python, which is in compressed format, you need to unpack the downloaded files. If you are using Unix, the GNA gzip program performs the required action. The GNA gzip program is available at www.gnu.org/software/gzip/gzip.html. For Windows, it is necessary to have the WinZip program to unpack the downloaded files. Winzip can be downloaded from www.winzip.com. To run Python, the system requirements are as shown in Table 1.2. You can choose from a host of software platforms to run Python. For the develop- ment of this book, the software configuration shown in Table 1.3 is used. Table 1.2 Hardware Specifications for Using Python HARDWARE SPECIFICATION Processor Pentium, 200 MHz RAM 64 MB, 128 MB (Recommended) 4 Chapter 1
  • 35. Table 1.3 Software Specifications for Using Python SOFTWARE SPECIFICATION Operating system Linux 7.1, Windows 2000 Server, and Windows NT Server Web server Apache 1.3.19-5, (IIS 5.0 for Windows) RDBMS My SQL 3.23.36-1 Web browser Netscape 4.76 GNU C++ For Windows NT/2000 Python Version 2.2a4 Install Python As mentioned earlier, Python distribution is available for a wide variety of platforms. You need to download only the binary code applicable for your platform and install Python. If the binary code for your platform is not available, you need a C compiler to compile the source code manually. Compiling the source code offers more flexibility in terms of choice of features that you require in your installation. For example, for Win- dows, you might want to install the additional Tcl/Tk support feature on which you can build your GUI applications or install Win32 extensions, COM extensions, and more. Similarly, you can choose to install Tkinter or the GNU readline module, which allows you to scroll back through Python commands in the interpreter. All this can be incorporated in the Unix installation of Python by editing the Setup file in the Modules subdirectory in the source distribution. Unix Installation After unpacking the files in the source distribution and converting them into a tar archive, you can install Python. This requires running the ./configure script in the Python archive. Then, type make at the shell prompt, and type make install. On Unix machines, the Python executable is usually installed in the /usr/local/bin directory, and its libraries are installed in /usr/local/lib/pythonXX where XX is the version of Python that you are using. Linux Installation Almost all major Linux distributions include Python. You might want to install the latest version of Python, though, even if Python is installed automatically for you. This can be done by using the RPM (RedHat Packet Manager) package for installation. The An Introduction to Python 5
  • 36. RPMs for Linux installation can be downloaded from www.python.org/2.2/rpms.html. You must execute the following command to update the RPM: rpm -Uhv python2.2-2.2b1-2.i386.rpm Or use the following command to install the RPM from the RPM package: rpm -ihv python2.2-2.2b1-2.i386.rpm (Note that the preceding filenames reflect the beta version of Python 2.2.) For a fresh installation of Python from the source code on a Linux machine, follow the same steps as for Unix installation. You can also download the source RPM and build a binary package by using the following command: rpm —rebuild python2.2-2.2b1-2.src.rpm Windows Installation On Windows, you can install Python by running Python-XXX.exe, where XXX is Python’s latest release. On Windows, double-clicking the file will launch the Installation Wizard, as shown in Figure 1.1. After installing Python, if you want to install PythonWin and PythonCOM software also, double-click the win32all-YYY.exe file. Each version of Python has a specific corresponding win32all file. Therefore, do not install the file that is intended for a different release. You can download this file for the specific version of Python from the following location: http://aspn.activestate.com/ASPN/Downloads/ActivePython/ Extensions/Win32all. Figure 1.1 Python Installation Wizard guides you through a simple installation process. 6 Chapter 1
  • 37. Start Python in Different Execution Modes You can start Python in three different ways. One way is to start the interpreter inter- actively where each line that you enter is executed at the same time. The second way is to run a script written in Python. In this case, the interpreter directly executes the script. Finally, you can run the interpreter in the form of a GUI that is part of the Inte- grated Development Environment (IDE). An IDE usually provides tools for debugging and editing text. Interactive Interpreter You can start Python in the command-line interpreter mode and start writing code. Any operating system that provides you with a command-line interpreter or a shell window, such as DOS or Unix, can start Python in an interactive interpreter mode. This mode can be extremely helpful when you want to test the specific features of Python. Unix. To start the Python interpreter, you need to type the full path to the Python executable if you have not added the directory containing the Python executable to your search path. Python usually exists in /usr/bin or /usr/local/bin directories. To add Python to the search path, you can add the full path of the directory containing the Python executable to the set path or PATH= directive. After this, refresh the shell’s path variable. Now, you can invoke the Python interpreter by typing python at the shell prompt. $python Typing python at the shell prompt will start the Python interpreter in the Unix environment and will show the Python primary prompt denoted by “” as shown in Figure 1.2. Figure 1.2 Starting Python in a Unix window. An Introduction to Python 7
  • 38. Figure 1.3 Starting Python in the Windows command line. Windows. In order to run Python directly by typing python at the command prompt, add Python to your search path. This is similar to what is done in Unix. You can do this by editing the C:Autoexec.bat file. The Python executable in Windows is usually installed in C:Program FilesPython or C:Python. In Windows also, you can start Python by typing python at the command prompt C:. This will start the Python interpreter in Windows, as shown in Figure 1.3. Script from the Command Line You can also request Python to directly execute a script from the command-line inter- face. This is the same for Windows, Unix, or any other operating system that supports command-line interface, as in the following commands: C:python myscript.py $ python myscript.py These commands, for Windows and Unix, execute the script myscript.py from the current directory. If the script you want to execute is not in the current directory, specify the complete path for the script. You can also invoke the Python interpreter automatically without explicitly invok- ing it from the command line. Include the following line to launch shell as the first line of your script: #!/usr/local/bin/python The path following #! is the full path of the location of the Python interpreter. Be careful to give the correct path name; if the path name is not correct, the shell will return an error message. 8 Chapter 1
  • 39. When you have added a startup directive to the beginning of your script, the Python interpreter does not need to be explicitly invoked. You can run the script directly using: $myscript.py Alternatively, you can use a command named env for the startup directive, which is installed in either /bin or /usr/bin. This command finds the Python interpreter in your path. You can use env when you do not know where the Python executable is located. You can also use env if you change its position frequently, but it is still avail- able through the directory path you specify. In Windows, if you have a Python IDE installed (this will be discussed in the next section), you can execute a script directly by double-clicking it. Integrated Development Environment Python can also be started from a graphical user interface (GUI) environment. This can be done using a GUI application, such as Tcl/Tk. Most GUI applications are IDEs as well. IDEs provide the additional features of editing, tracing errors, and debugging. Unix. IDLE is the first Unix IDE for Python. IDLE is Tkinter based and requires Tcl/Tk to be installed on your system. You do not need to install Tcl/Tk fully because the current versions of Python include the minimal subset of the Tcl/Tk library in the distribution. The IDLE executable is located in the Tools subdirectory with the source distrib- ution. IDLE can be invoked by typing idle at the shell prompt. Figure 1.4 shows the IDLE window in Unix. Figure 1.4 Starting IDLE in Unix. An Introduction to Python 9
  • 40. Figure 1.5 The PythonWin environment in Windows. Windows. PythonWin is the first Windows IDE for Python. The PythonWin distribution includes Win32 API extensions, COM extensions, and Tcl/Tk. PythonWin can be invoked by executing the file pythonwin.exe, which is usually located in the same directory as Python in the Pythonwin subdirectory C:Program FilesPythonPythonwin. Among its main features are a color text editor, a debugger, an interactive shell window, and more. Figure 1.5 shows the PythonWin environment running in Windows, including the main PythonWin window and a script open in its integrated source code editor. As mentioned earlier, PythonWin can be installed by running the executable file win32all-YYY.exe specific for the version of Python that you have on your computer. You can obtain more information on PythonWin from the Pythonwin readme file, which is located at C:Program FilesPythonPythonwin readme.html or any other location where PythonWin is installed. Besides PythonWin, IDLE can also be installed on the Windows platform. It is in the Tools or Idle subdirectory of the folder where Python is installed. To start IDLE, double-click the idle.pyw executable. Figure 1.6 shows the IDLE window in Windows. 10 Chapter 1
  • 41. Figure 1.6 The IDLE environment in Windows. Macintosh. The Python version that runs on Macintosh is called MacPython. It is also available on www.python.org and can be downloaded as MacBinary or BinHex’d files. Python source code is also available on the main Web site as a Stuff-It archive, and the full version is available as a unique file, which also includes Tkinter and IDLE. As in Unix and Windows, IDLE also works on Macintosh. Figure 1.7 shows the IDLE environment in Macintosh. Figure 1.7 The IDLE environment in Macintosh. An Introduction to Python 11
  • 42. Summary In this chapter, you learned the following: ■ ■ Python is currently available in five stable versions: 1.5.2, 1.6, 2.0, 2.1.1, and 2.2. The final release of the latest version Python 2.2 was made available in Decem- ber 2001. ■ ■ You can find all the latest information about Python on the Python official Web site or the Pythonlabs Web site. The links, respectively, are: http://www.python.org (Community home page) http://www.pythonlabs.com (Commercial home page) ■ ■ Python runs on a wide variety of platforms, such as Unix, Windows, Macintosh, X Windows, OS/2, Be-OS, VMS, and Amiga, to name a few. ■ ■ You can download the Python distribution for Unix, Windows, and Mac systems from the link www.python.org/download. In addition, the Python documenta- tion, news, and other articles are also available on this site. You can download the Python documentation from www.python.org/doc/. This documentation is available in HTML, PDF, and PostScript formats. ■ ■ To install Python, download the binary applicable for your platform and execute it in the way applicable for your platform. ■ ■ Python can be started in three different ways: ■ ■ As the interactive interpreter ■ ■ Directly executing a script from the command line ■ ■ As an Integrated Development Environment (IDE) 12 Chapter 1
  • 43. 13 OBJECTIVES: In this chapter, you will learn to do the following: Write your first Python program Use comments Use Python as a calculator Use variables Use standard data types: Number String List Tuple Dictionary Examine memory management in Python Getting Started with Python C HAPTE R 2 C HAPTE R
  • 44. Discovering Diverse Content Through Random Scribd Documents
  • 45. Parmelia saxatilis during a period of eight years: the yearly increase of the thallus was half a centimetre, so that specimens of twenty centimetres in breadth must have been growing from forty to fifty years. Bitter’s[903] observations on Parmelia physodes agree in the main with those of Vallot: the increase of the upper lobes during the year was 3-4 mm. In a more favourable climate Heere found that Parmelia caperata (Fig. 49) on a trunk of Aesculus in California had grown longitudinally 1·5 cm. and transversely 1 cm. The measurements extended over a period of seven winter months, five of them being wet and therefore the most favourable season of growth. In warm regions lichens attain a much greater size than in temperate or northern countries, and growth must be more rapid. A series of measurements was also made by Heere[904] on Ramalina reticulata (Fig. 64), a rapid growing tree-lichen, and one of the largest American species. The shorter lobes were selected for observation, and were tested during a period of seven months from September to May, five of the months being in the wet season. There was great variation between the different lobes but the average increase during that period was 41 per cent. Krabbe[905] took notes of the colonization of Cladonia rangiferina (Fig. 127) on burnt soil: in ten years the podetia had reached a height of 3 to 5 cm., giving an annual growth of about 3-5 mm. It is not unusual to find specimens in northern latitudes 18 inches long (50 cm.), which, on that computation, must have been 100 to 160 years old; but while increase goes on at the apex of the podetia, there is constant perishing at the base of at least as much as half the added length and these plants would therefore be 200 or 300 years old. Reinke[906] indeed has declared that apical growth in these Cladina species may go on for centuries, given the necessary conditions of good light and undisturbed habitat. Other data as to rate of growth are furnished by Bonnier[907] in the account of his synthetic cultures which developed apothecia only after two to three years. The culture experiments of Darbishire[908] and Tobler[909] with Cladonia soredia are also instructive, the former with synthetic spore- and alga-cultures having obtained a growth of soredia in about seven months; the latter, starting with soredia, had a growth of well-formed squamules in nine months. It has been frequently observed that abundance of moisture facilitates growth, and this is nowhere better exemplified than in crustaceous soil-lichens. Meyer found that on lime-clay soil which had been thrown up from a ditch in autumn, lichens such as Gyalecta geoica were fully developed the following summer. He gives an account also of another soil species, Verrucaria (Thrombium) epigaea, which attained maturity during the winter half of the year. Stahl[910] tells us that Thelidium minutulum, a pyrenocarpous soil-lichen, with a primitive and scanty thallus, was cultivated by him from spore to spore in the space of three months. Such lichens retain more of the characteristics of fungi than do those with a better developed thallus. Rapid colonization by a soil-lichen was also observed in Epping Forest by Paulson[911]. In autumn an extensive growth of Lecidea uliginosa covered as if with a dark stain patches of soil that had been worn bare during the previous spring. The lichen had reached full development and was well fruited. These facts are quite in harmony with other observations on growth made on Epping Forest lichens. The writers[912] of the report record the finding of “fruiting lichens overspreading decaying leaves which can scarcely have lain on the ground more than two or three years; others growing on old boots or on dung and fruiting freely; others overspreading growing mosses.” They also cite a definite instance of a mass of concrete laid down in 1903 round a
  • 46. surface-water drain which in 1910—seven years later—was covered with Lecanora galactina in abundant fruit; and of another case of a Portland stone garden-ornament, new in 1904, and, in 1910, covered with patches of a fruiting Verrucaria (probably V. nigrescens). Both these species, they add, have a scanty thallus and generally fruit very freely. A series of observations referring to growth and “ecesis” or the spreading of lichens have been made by Bruce Fink[913] over a period of eight years. His aim was mainly to determine the time required for a lichen to re-establish itself on areas from which it had been previously removed. Thus a quadrat of limestone was scraped bare of moss and of Leptogium lacerum, except for bits of the moss and particles of the lichen which adhered to the rock, especially in depressions of the surface. After four years, the moss was colonizing many small areas on which grew patches of the lichen 2 to 10 mm. across. Very little change occurred during the next four years. Numerous results are also recorded as to the rate of growth, the average being 1 cm. per year or somewhat under. The greatest rate seems to have been recorded for a plant of Peltigera canina growing on “a mossy rock along a brook in a low moist wood, well-shaded.” A plant, measuring 10 by 14 cm., was deprived of several large apothecia. The lobes all pointed in the same direction, and the plant increased 1·75 cm. in one year. Two other plants, deprived of their lobes, regenerated and increased from 2 and 5 cm. respectively to 3·5 and 6 cm. No other measurements are quite so high as these, though a plant of Parmelia caperata (sterile), measuring from 1 to 2 cm. across, reached in eight years a dimension of 10 by 13 cm. Other plants of the same species gave much slower rates of increase. A section of railing was marked bearing minute scattered squamules of Cladonia pityrea. After two years the squamules had attained normal size and podetia were formed 2 to 4 mm. long. Several areas of Verrucaria muralis were marked and after ten months were again measured; the largest plants, measuring 2·12 by 2·4 cm. across, had somewhat altered in dimensions and gave the measurements 2·2 by 3 cm. Some crustose species became established and produced thalli and apothecia in two to eight years. Foliose lichens increased in diameter from 0·3 to 3·5 cm. per year. So far as external appearance goes, apothecia are produced in one to eight years; it is concluded that they require four to eight years to attain maturity in their natural habitats. B. Season of Fruit Formation The presence of apothecia (or perithecia) in lichens does not always imply the presence of spores. In many instances they are barren, the spores having been scattered or not yet matured; the disc in these cases is composed of paraphyses only, with possible traces of asci. In any month of the year, however, some lichens may be found in fruit. Baur[914] found, for instance, that Parmelia acetabulum developed carpogonia the whole year round, though somewhat more abundantly in spring and autumn. Pertusaria communis similarly has a maximum period of fruit-formation at these two seasons. This is probably true of tree-lichens generally: in summer the shade of the foliage would inhibit the formation of fruits, as would the extreme cold of winter; but were these conditions relaxed spore-bearing fruits might be expected at any season though perhaps not continuously on the same specimen. An exception has been noted by Baur in Pyrenula nitida, a crustaceous tree Pyrenolichen. He found carpogonia only in February and April, and the perithecia matured in a few weeks,
  • 47. presumably at a date before the trees were in full leaf; but even specimens of Pyrenula are not unusual in full spore-bearing conditions in the autumn of the year. To arrive at any true knowledge as to the date and duration of spore production, it would be necessary to keep under observation a series of one species, examining them microscopically at intervals of a few weeks or months and noting any conditions that might affect favourably or unfavourably the reproductive organs. A comparison between corticolous and saxicolous species would also be of great interest to determine the influence of the substratum as well as of light and shade. But in any case it is profitable to collect and examine lichens at all seasons of the year, as even when the bulk of the spores is shed, there may remain belated apothecia with a few asci still intact. C. Dispersal and Increase The natural increase of lichen plants may primarily be sought for in the dispersal of the spores produced in the fruiting-bodies. These are ejected, as in fungi, by the pressure of the paraphyses on the mature ascus. The spores are then carried away by wind, water, insects, etc. In a few lichens gonidia are enclosed in the hymenium and are ejected along with the spores, but, in most, the necessary encounter with the alga is as fortuitous, and generally as certain, as the pollination of anemophilous flowers. A case of dispersal in Sagedia microspora has been described by Miyoshi[915] in which entire fruits, small round perithecia, were dislodged and carried away by the wind. The addition of water caused them to swell enormously and brought about the ejection of the spores. Areas covered by the thallus are also being continually enlarged by the spreading growth of the hypothallus. a. Dispersal of Crustaceous Lichens. These lichens are distributed fairly equally on trees or wood (corticolous) and on rocks (saxicolous). Some species inhabit both substrata. As regards corticolous lichens that live on smooth bark such as hazel or mountain-ash, the vegetative body or thallus is generally embedded beneath the epidermis of the host. Soredia are absent and the thallus is protected from dispersal. In these lichens there is rather an abundant and constant formation of apothecia or perithecia. Other species that affect rugged bark and are more superficial are less dependent on spore production. The thallus is either loosely granular, or is broken up into areolae. The areolae are each a centre of growth, and with an accession of moisture they swell up and exert pressure on each other. Parts of the thallus thus become loosened and are dislodged and carried away. If anchored on a suitable substratum they grow again to a complete lichen plant. Sorediate lichens are dependent almost wholly on these bud-like portions for increase in number; soredia are easily separated from the parent plant, and easily scattered. Darbishire[916] noted frequently that small Poduridae in moving over the surface of Pertusaria amara became powdered with soredia and very evidently took a considerable part in the dissemination of the species. Crustaceous rock lichens are rarely sorediate, but they secure vegetative propagation[917] by the dispersal of small portions of the thallus. The thalli most securely attached are cracked into small areolae which, by unequal growth, become very soon lop-sided, or, by intercalary increase, form little warts and excrescences on their surface. These irregularities of development give rise to more or less tension which induces a loosening of the thallus from the substratum. Weather changes act similarly and gradually the areolae are broken off. Loosening influence is also exercised by the developing fruits, the expanding growth of which pushes
  • 48. aside the neighbouring tissues. Wind or water then carries away the thalline particles which become new centres of growth if a suitable substratum is reached. b. Dispersal of Foliose Lichens. It is a matter of common observation that, in foliose lichens where fruits are abundant, there are few or no soredia and vice versa. In either case propagation is ensured. In addition to these obvious methods of increase many lichens form isidia, outgrowths from the thallus which are easily detached. Bitter[918] considers for instance that the coralloid branchlets, which occur in compact tufts on the thallus of Umbilicaria pustulata, are of immense service as organs of propagation. Apothecia and pycnidia are rarely present in that species, and the plant thus falls back on vegetative production. Slender crisp thalline outgrowths, easily separable, occur also on the edges of lobes, as in species of Peltigera, Platysma, etc. Owing to the gelatinous character of lichen hyphae, the thallus quickly becomes soft with moisture and is then easily torn and distributed by wind, animals, etc. The action of lichens on rocks has been shown to be of a constantly disintegrating character, and the destruction of the supporting rock finally entails the scattering of the plant. This cause of dispersal is common to both crustaceous and foliose species. The older central parts of a lichen may thus have disappeared while the areolae on lobes of the circumference are still intact and in full vigour. As in crustaceous lichens the increase in the area of growth may take place by means of the lichen mycelium which, originating from the rhizinae in contact with the substratum, spreads as a hypothallus under the shelter of the lobes and far beyond them. When algae are encountered a new lobe begins to form. The process can be seen perhaps most favourably in lichens on decaying wood which harbours moisture and thus enables the wandering hyphae to retain life. c. Dispersal of Fruticose Lichens. Many of these lichens are abundantly fruited; in others soralia are as constantly developed. Species of Usnea, Alectoria, Ramalina and many Cladoniae are mainly propagated by soredia. They are all peculiarly liable to be broken and portions of the thallus scattered by the combined action of wind and rain. Peirce[919] found that Ramalina reticulata (Fig. 65), of which the fronds are an open network, was mainly distributed by the tearing of the lichen in high wind. This takes place during the winter rains, when not only the lichen is wet and soft in texture, but when the deciduous trees are bare of leaves, at a season, therefore, when the drifting thalline scraps can again catch on to branch or stem. A series of observations on the dispersal of forms of long pendulous Usneas was made by Schrenk[920]. In the Middle and North Atlantic States of America these filamentous species rarely bear apothecia. The high winds break and disperse them when they are in a wet condition. They generally grow on Spruces and Firs, because the drifting filaments are more easily caught and entangled on short needles. The successive wetting and drying causes them to coil and uncoil, resulting in a tangle impossible to unravel, which holds them securely anchored to the support. D. Erratic Lichens In certain lichens, there is a tendency for the thallus to develop excrescences of nodular form which easily become free and drift about in the wind while still living and growing. They are carried sometimes very long distances, and fall in thick deposits over localities far from their place of origin. The most famous instance is the “manna lichen,” Lecanora esculenta, which has been scientifically examined and described by Elenkin[921]. He distinguishes seven different forms of the species: f. esculenta, f. affinis, f. alpina, and f. fruticulosa-foliacea which are Alpine
  • 49. lichens, the remainder, f. desertoides, f. foliacea and f. esculenta-tarquina, grow on the steppes or in the desert[922]. Elenkin[921] adds to the list of erratic lichens a variety of Parmelia molliuscula along with P. ryssolea from S. Russia, from the Asiatic steppes and from Alpine regions. Mereschkovsky[923] has also recorded from the Crimea Parmelia vagans, probably derived from P. conspersa f. vaga (f. nov.). It drifts about in small rather flattened bits, and, like other erratics, it never fruits. Meyer[924] long ago described the development of wandering lichens: scraps that were torn from the parent thallus continued to grow if there were sufficient moisture, but at the same time undergoing considerable change in appearance. The dark colour of the under surface disappears in the frequently altered position, as the lobes grow out into narrow intermingling fronds forming a more or less compact spherical mass; the rhizoids also become modified and, if near the edge, grow out into thread-like structures which bind the mass together. Meyer says that “wanderers” have been noted as belonging to Parmelia acetabulum, Platysma glaucum and Anaptychia ciliaris.
  • 50. Fig. 121. Parmelia revoluta var. concentrica Cromb. a, plant on flint with detached fragment; b, upper surface of three specimens; c, three specimens as found on chalk downs; d, specimens in section showing central cavity (S. H., Photo.). The most notable instance in Britain of the “erratic” habit is that of Parmelia revoluta var. concentrica (Fig. 121), first found on Melbury Hill near Shaftesbury, Dorset, and described as “a spherical unattached lichen which rolls on the exposed downs.” It has recently been observed on the downs near Seaford in Sussex, where, however, it seems to be confined to a small area about eight acres in extent which is exposed to south-west winds. The lichen is freely distributed over this locality. To R. Paulson and Somerville Hastings[925] we owe an account of the occurrence and origin of the revoluta wanderers. The specimens vary considerably in shape and size, and measure from 1 to 7 cm. in longest diameter. Very few are truly spherical, some are more or less flattened and many are quite irregular. The revolute edges of the
  • 51. overlapping lobes give a rough exterior to the balls, which thereby become entangled amongst the grass, etc., and movement is impeded or prevented, except in very high winds. Crombie[926] had suggested that the concentric plant originated from a corticolous habitat, but no trees are near the Seaford locality. Eventually specimens were found growing on flints in the immediate neighbourhood. While still on the stone the lichen tends to become panniform, a felt of intermingling imbricate lobes is formed, portions of which, in time, become crowded out and dislodged. When scattered over the ground, these are liable to be trampled on by sheep or other animals and so are broken up; each separate piece then forms the nucleus of new concentric growth. Crombie[926] observed at Braemar, drifting about on the detritus of Morrone, an analogous structure in Parmelia omphalodes. He concluded that nodular excrescences of the thallus had become detached from the rocks on which the lichen grew; while still attached to the substratum Parmelia omphalodes and the allied species, P. saxatilis, form dense cushion-like masses. E. Parasitism a. General Statement. The parasitism of Strigula complanata, an exotic lichen found on the leaves of evergreen trees, has been already described[927]; Dufrenoy[928] records an instance of hyphae from a Parmelia thallus piercing pine-needles through the stomata and causing considerable injury. Lichen hyphae have attacked and destroyed the protonemata of mosses. Cases have also been recorded of Usnea and Ramalina penetrating to the living tissue of the tree on which they grew, and there may be other similar parasitisms; but these exceptions serve to emphasize the independent symbiotic growth of lichens. There are however some lichens belonging to widely diverse genera that have retained, or reverted to, the saprophytic or parasitic habit of their fungal ancestors, though the cases that occur are generally of lichens preying on other lichens. The conditions have been described as those of “antagonistic symbiosis” when one lichen is hurtful or fatal in its action on the other, and as “parasymbiosis” when the association does little or no injury to the host. The parasitism of fungi on lichens, though falling under a different category, in many instances exhibits features akin to parasymbiosis. The parasitism of fungus on fungus is not unusual; there are instances of its occurrence in all the different classes. In the Phycomycetes there are genera wholly parasitic on other fungi such as Woronina and other Chytridiaceae; Piptocephalus, one of the Mucorini, is another instance. Cicinnobolus, one of the Sphaeropsideae, preys on Perisporiae; a species of Cordyceps is found on Elaphomyces, and Orbilia coccinella on Polyporus; while among Basidiomycetes, Nyctalis, an agaric, grows always on Russula.
  • 52. There are few instances of lichens finding a foothold on fungi, for the simple reason that the latter are too short lived. On the perennial Polyporeae a few have been recorded by Arnold[929], but these are not described as doing damage to the host. They are mostly species of Lecidea or of allied genera. Kupfer[930] has also listed some 15 different lichens that he found on Lenzites sp. b. Antagonistic Symbiosis. In discussing the nutrition of lichens[931] note has been taken of the extent to which some species by means of enzymes destroy the thallus of other lichens in their vicinity and then prey on the dead tissues. A constantly cited[932] example is that of Lecanora atriseda which in its early stages lives on the thallus of Rhizocarpon geographicum inhabiting mountain rocks. A detailed examination of the relationship between these two plants was made by Malme and later by Bitter[933]. Both writers found that the Lecanora thallus as it advanced caused a blackening of the Rhizocarpon areolae, the tissues of which were killed by the burrowing slender filaments of the Lecanora, easily recognized by their longer cells. The invader thereafter gradually formed its own medulla, gonidial layer and cortex right over the surface of the destroyed thallus. Lecidea insularis (L. intumescens) similarly takes possession of and destroys the thallus of Lecanora glaucoma and Malme[932] strongly suspects that Buellia verruculosa and B. aethalea may be living on the thallus of Rhizocarpon distinctum with which they are constantly associated. Other cases of facultative parasitism have been studied by Hofmann[934], more especially three different species, Lecanora dispersa, Lecanora sp. and Parmelia hyperopta, which were found growing on the thick foliose thallus of Dermatocarpon miniatum. These grew, at first independently, on a wall along with many examples of Endocarpon on to which they spread as opportunity offered. The thallus of the latter was in all cases distorted, the area occupied by the invaders being finally killed. The attacking lichens had benefited materially by the more nutritive substratum: their apothecia were more abundant and their thallus more luxuriant. The gonidia especially had profited; they were larger, more brightly coloured, and they increased more freely. Hoffmann offers the explanation that the strain on the algae of providing organic food for the hyphal symbiont was relaxed for the time, hence their more vigorous appearance. Arthonia subvarians is always parasitic on the apothecia of Lecanora galactina, and Almquist[935] discovered that the hymenium of the host alone is injured, the hypothecium and excipulum being left intact. The “parasitism” of Pertusaria globulifera on Parmelia perlata and P. physodes, as described by Bitter[936], may also be included under antagonistic symbiosis. The hyphae pierce the Parmelia thallus, break it up and gradually absorb it. Chemical as well as mechanical influences are concerned in the work of destruction as both the fungus and the alga of the victim are dissolved. Lecanora tartarea already dealt with
  • 53. as a marauding lichen[937] over decaying vegetation may spread also to living lichens. Fruticose soil species, such as Cetraria aculeata and others, die from the base and the Lecanora gains entrance to their tissues at the decaying end which is open. Arnold[938] speaks of these facultative parasites that have merely changed their substratum as pseudo-parasites, and he gives a list of instances of such change. In many cases it is rather the older thalli that are taken possession of, and, in nearly every case, the invader is some crustaceous species. The plants attacked are generally ground lichens or more particularly those that inhabit damp localities, such as Peltigera or Cladonia or certain bark lichens. Drifting soredia or particles of a lichen would easily take hold of the host thallus and develop in suitable conditions. To give a few of the instances observed, there have been found, by Arnold, Crombie and others: on Peltigera canina: Callopisma cerina, Rinodina turfacea var., Bilimbia obscurata and Lecanora aurella; on Peltigera aphthosa: Lecidea decolorans; on Cladoniae: Bilimbia microcarpa, Bacidia Beckhausii and Urceolaria scruposa, etc. Urceolaria (Diploschistes) has a somewhat bulky crustaceous thallus which may be almost evanescent in its semi-parasitic condition, the only gonidia retained being in the margin of the apothecia. Nylander[939] found isolated apothecia growing vigorously on Cladonia squamules. Hue[940] describes Lecanora aspidophora f. errabunda, an Antarctic lichen, as not only a wanderer but as a “shameless robber.” It is to be seen everywhere on and about other lichens, settling small glomeruli of apothecia here and there on the thallus of Umbilicariae or between the areolae of Buelliae, and always too vigorous to be ousted from its position. Bacidia flavovirescens has been regarded by some lichenologists[941] as a parasite on Baeomyces, but recent work by Tobler[942] seems to have proved that the bright green thallus is that of the Bacidia. c. Parasymbiosis. There are certain lichens that are obligative parasites and pass their whole existence on an alien thallus. They may possibly have degenerated from the condition of facultative parasitism as the universal history of parasitism is one of increased dependence on the host, and of growing atrophy of the parasite, but, in the case of lichens, there is always the peculiar symbiotic condition to be considered: the parasite produces its own vigorous hyphae and normal healthy fruits, it often claims only a share of the carbohydrates manufactured by the gonidia. The host lichen is not destroyed by this parasymbiosis though the tissues are very often excited to abnormal growth by the presence of the invading organism.
  • 54. Lauder Lindsay[943] was one of the first to study these “microlichens” as he called them, and he published descriptions of those he had himself observed on various hosts. He failed however to discriminate between lichens and parasitic fungi. It is only by careful research in each case that the affinity to fungi or to lichens can be determined; very frequently the whole of them, as possessing no visible thallus, have been classified with fungi, but that view ignores the symbiosis that exists between the hyphae of the parasite and the gonidia of the host. Parasitic lichens are rather rare on gelatinous thalli; but even among these, a few instances have been recorded. Winter[944] has described a species of Leptoraphis, the perithecia of which are immersed in the thallus of Physma franconicum. The host is wholly unaffected by the presence of the parasite except for a swelling where it is situated. The foreign hyphae are easily distinguishable; they wander through the thallus of the host with their free ends in the mucilage of the gonidial groups from which they evidently extract nourishment. Species of the lichen genus Obryzum are also parasitic on gelatinous lichens. The parasitic genus Abrothallus[945] has been the subject of frequent study. There are a number of species which occur as little black discs on various thalli of the large foliose lichens. They were first of all described as parasitic fungi, later Tulasne[946] affirmed their lichenoid nature as proved by the structure, consistence and long duration of the apothecia. Lindsay[947] wrote a monograph of the genus dealing chiefly with Abrothallus Smithii (Buellia Parmeliarum) and A. oxysporus, with their varieties and forms that occur on several different hosts. In some instances the thallus is apparently quite unaffected by the presence of Abrothallus, in others, as in Cetraria glauca, there is considerable hypertrophy produced, the portion of the thallus on which the parasites are situated showing abnormal growth in the form of swellings or pustules which may be regarded as gall-formations. Crombie[948] points this out in a note on C. glauca var. ampullacea, figured first by Dillenius, which is merely a swollen condition due to the presence of Abrothallus. The internal structure and behaviour of Abrothallus has more recently been followed in detail by Kotte[949]. He recognized a number of different species growing on various thalli of Parmelia and Cetraria, but Abrothallus Cetrariae was the only one that produced gall-formation. The mycelium of the parasite in this instance penetrates to the medulla of the host lichen as a loose weft of hyphae which are divided into more or less elongate cells. These send out side branches, which grow towards the algal cells, and by their short-celled filaments clasp them exactly in the same way as do the normal lichen hyphae. Thus in the neighbourhood of the parasite an algal cell may be surrounded by the hyphae not only of the host, but also by those of Abrothallus. The two different hyphae can generally be distinguished by their reaction to iodine: in some cases Abrothallus hyphae take the stain, in others the host hyphae. In addition to apothecia, spermogonia or pycnidia are produced, but in one of the species examined by Kotte, Abrothallus Peyritschii on Cetraria
  • 55. caperata, there was no spermogonial wall formed. The hyphae also penetrate the host soredia or isidia, so that on the dispersal of these vegetative bodies the perpetuation of both organisms is secured in the new growth. Abrothallus draws its organic food from the gonidia in the same way as the host species, and possibly the parasitic hyphae obtain also water and inorganic food along with the host hyphae. They have been traced down to the rhizinae and may even reach the hypothallus, but no injury to the host has been detected. It is a case of joint symbiosis and not of parasitism. Microscopic research has therefore justified the inclusion of these and other forms among lichens. d. Parasymbiosis of Fungi. There occur on lichens, certain parasites classed as fungi which at an early stage are more or less parasymbionts of the host; as growth advances they may become parasitic and cause serious damage, killing the tissues on which they have settled. Zopf[950] found several instances of such parasymbiosis in his study of fungal parasites, such as Rhymbocarpus punctiformis, a minute Discomycete which inhabits the thallus of Rhizocarpon geographicum. By means of staining reagents he was able to trace the course of the parasitic hyphae, and found that they travelled towards the gonidia and clasped them lichen-wise without damaging them, since these remained green and capable of division. At no stage was any harm caused to the host by the alien organism. Another instance he observed was that of Conida rubescens on the thallus of Rhizocarpon epipolium. By means of fine sections through the apothecia of Conida and the thallus of the host, he proved the presence of numerous gonidia in the subhymenial tissue, these being closely surrounded by the hyphae of the parasite, and entirely undamaged: they retained their green colour, and in size and form were unchanged. Zopf[951] at first described these parasites as fungi though later[951] he allows that they may represent lower forms of lichens. Tobler[952] has added two more of these parasymbiotic species on the border line between lichens and fungi, similar to those described by Zopf. One of these, Phacopsis vulpina, belonging to the fungus family Celidiaceae, is parasitic on Letharia vulpina. The fronds of the host plant are considerably altered in form by its presence, being more branched and curly. Where the parasite settles a swelling arises filled with its hyphae, and the host gonidia almost disappear from the immediate neighbourhood, only a few “nests” being found and these very mucilaginous. These nests as well as single gonidia are surrounded by Phacopsis hyphae which have gradually displaced those of the Letharia thallus. The gonidia are excited to division and increase in number on contact with either lichen or fungus hyphae, but in the latter case the increase is more abundant owing doubtless to a more powerful chemical irritant in the fungus. As development advances, the Phacopsis hyphae multiply to the exclusion of both lichen hyphae and gonidia from the area of invasion. Finally the host cortex is split, the fungus bursts through, and the tissue beneath the parasite becomes brown and dead. Phacopsis begins as a
  • 56. “parasymbiont,” then becomes parasitic, and is at last saprophytic on the dead cells. The hyphae travel down into the medulla of the host and also into the soredial outgrowths, and are dispersed along with the host. The effect of Verrucula on the host thallus may also be cited[953]. Tobler gives the results of his examination of still another fungus, Karschia destructans. It becomes established on the thallus of Chaenotheca chrysocephala and its hyphae gradually penetrate down to the underlying bark (larch). The lichen thallus beneath the fungus is killed, but gonidia in the vicinity are sometimes clasped: Karschia also is thus a parasymbiont, then a parasite, and finally a saprophyte. Elenkin[954] describes certain fungi which to some extent are parasymbionts. One of these, Conidella urceolata n. sp., grew on forms of Lecanora esculenta. The other, a stroma-forming species, had invaded the thallus of Parmelia molliuscula, where it caused gall-formation. As the growth of the gall was due to the co-operation of the lichen gonidia, the fungus must at first have been a parasymbiont. Only dead gonidia were present in the stroma; probably they had been digested by the parasite. Because of the stroma Elenkin placed the fungus in a new genus, Trematosphaeriopsis. e. Fungi Parasitic on Lichens. A solution or extract of lichen thallus is a very advantageous medium in which to grow fungi. It is therefore not surprising that lichens are a favourite habitat for parasitic fungi. Stahl[955] has noted that the lichens themselves flourish best where there is frequent moistening by rain or dew with equally frequent drying which effectively prevents the growth of fungi. Species of Peltigera are however able to live in damp conditions: without being injured, they have been observed to maintain their vigour when cultivated in a very moist hothouse while all the other forms experimented with were attacked and finally destroyed by various fungi. Lindsay[956] devoted a great deal of attention to the microscopic study of the minute fruiting bodies so frequently present on lichen thalli and published descriptions of microlichens, microfungi and spermogonia. He and others naturally considered these parasitic organisms to be in many cases either the spermogonia or pycnidia of the lichen itself. It is often not easy to determine their relationship or their exact systematic position; many of them are still doubtful forms. There exists however a very large number of fully recognized parasitic microfungi belonging to various genera. Lindsay discovered many of them. Zopf[957] has given exact descriptions of a series of forms, with special reference to their effect on the host thallus. In an early paper he described a species, Pleospora collematum, that he found on Physma compactum and other Collemaceae. The hyphae of the parasite differed from those of the host in being of a yellow colour; they did not penetrate or spread far, being restricted to rhizoid-like filaments at the base of their fruiting bodies (perithecia and pycnidia). Their presence caused a slight protuberance but
  • 57. otherwise did no harm to the host; the Nostoc cells in their immediate vicinity were even more brightly coloured than in other parts of the thallus. In another paper[958] he gives an instance of gall-formation in Collema pulposum induced by the presence of the fungus Didymosphaeria pulposi. Small protuberances were formed on the margins of the apothecia, more rarely on the lobes of the thallus, each one the seat of a perithecium of the fungus. No damage was done to either constituent of the thallus. Agyrium flavescens grows parasitically on the under surface of Peltigera polydactyla. M. and Mme Moreau[959] found that the hyphae of the fungus spread between the medullary filaments of the lichen; no haustoria were observed. The mature fruiting body had no distinct excipulum, but was surrounded by a layer of dead lichen cells. It is not easy to determine the difference between parasites that are of fungal nature and those that are lichenoid; but as a general rule the fungi may be recognized by their more transient character, very frequently by their effect on the host thallus, which is more harmful than that produced by lichens, and generally by their affinity to fungi rather than to lichens. Opinions differ and will continue to differ on this very difficult question. The number of such fungi determined and classified has gradually increased, and now extends to a very long list. Even as far back as 1896 Zopf reckoned up 800 instances of parasitism of 400 species of fungi on about 350 different lichens and many more have been added. Abbé Vouaux[960] is the latest writer on the subject, but his work is mostly a compilation of species already known. He finds representatives of these parasites in nine families of Pyrenomycetes and six of Discomycetes. He leaves out of account the much debated Coniocarps, but he includes with fungi all those that have been proved to be parasymbiotic, such as Abrothallus. A number of fungus genera, such as Conida, etc., are parasitic only on lichens. Most of them have one host only; others, such as Tichothecium pygmaeum, live on a number of different thalli. Crustaceous species are often selected by the parasites, and no great damage, if any, is caused to these hosts, except when the fungus is seated on the disc of the apothecium, so that the spore-bearing capacity is lessened or destroyed. In some of the larger lichens, however, harmful effects are more visible. In Lobaria pulmonaria, the fruits of which are attacked by the Discomycete, Celidium Stictarum[961], there is at first induced an increased and unusual formation of lichen apothecia. These apothecia are normally seated for the most part on the margins of the lobes or pustules, but when they are invaded by the fungus, they appear also in the hollows between the pustules and even on the under surface of the thallus. In the large majority of cases the fungus is partly or entirely embedded in the thallus;
  • 58. the gonidia in the vicinity may remain green and healthy, or all the tissues in the immediate neighbourhood of the parasite may be killed. f. Mycetozoa Parasitic on Lichens. Mycetozoa live mostly on decayed wood, leaves, humus, etc. One minute species, Listerella paradoxa, always inhabits the podetia of Cladonia rangiferina. Another species, Hymenobolina parasitica, was first detected and described by Zukal[962] as a true parasite on the thallus of Physciaceae; it has since been recorded in the British Islands on Parmeliae[963]. This peculiar organism differs from other mycetozoa in that the spores on germination produce amoebae. These unite to form a rose-red plasmodium which slowly burrows into the lichen thallus and feeds on the living hyphae. It is a minute species, but when abundant the plasmodia can just be detected with the naked eye as rosy specks scattered over the surface of the lichen. Later the grey sporangia are produced on the same areas. F. Diseases of Lichens a. Caused by Parasitism. Zopf[964] has stated that of all plants, lichens are the most subject to disease, reckoning as diseases all the instances of parasitism by fungi or by other lichens. There are however only rare instances in which total destruction or indeed any permanent harm to the host is the result of such parasitism. At worst the trouble is localized and does not affect the organism as a whole. Some of these cases have been already noted under antagonistic symbiosis or parasymbiosis. Several instances have however been recorded where real injury has been caused by the penetration of some undetermined fungus mycelium. Zukal[965] records two such observed by him in Parmelia encausta and Physcia villosa: the thallus of the former was dwarfed and deformed by the presence of the alien mycelium, the latter was excited to abnormal proliferation. b. Caused by crowding. Lichens suffer frequently from being overgrown by other lichens; they may also be crowded out by other plants. My attention was called by Mr P. Thompson to a burnt plot of ground in Epping Forest, which, after the fire, had been colonized by Peltigera spuria. In the course of a few years, other vegetation had followed, depriving the lichen of space and light and gradually driving it out. When last examined only a few miserable specimens remained, and these were reduced in vitality by an attack of the lichen parasite Illosporium carneum. c. Caused by adverse conditions. Zukal considers as pathological, at least in origin, the cracking of the thallus so frequent in crustaceous lichens as well as in the more highly developed forms. As the cracks are beneficial in the aeration of the plant, they can hardly be regarded as symptoms of a diseased condition. The more evident ringed breaks in the cortex of Usneae, due probably to wind action, have more reason to be so regarded; they are most pronounced in Usnea articulata, where the portions bounded by the rings are contracted and swollen, and a hollow space is formed between the cortex and the central axis. The swellings that are produced on
  • 59. lichen thalli, such as those of Umbilicaria and some species of Gyrophora, due to intercalary growth are normal to the plant, though occasionally the swollen weaker portions may become ruptured and the cortex be thrown off. As pathological also must be regarded the loss of cortex sometimes occasioned by excessive soredial formation at the margins of the lobes: the upper cortex may be rolled back and eventually torn away; the gonidial layer is exposed and transformed into soredia which are swept away by the wind and rain, till finally only traces of the lower cortex are left. Zukal[966] has instanced, as a case of diseased condition observed by him, the undue thickening of the cortex in Pertusaria communis whereby the formation of the fruiting bodies is inhibited and even vegetative development is rendered impossible. There arrives finally a stage when splitting takes place and the whole thallus breaks down and disappears. As a rule however there need be no limit to the age of the lichen plant. There is no vital point or area in the thallus; injury of one part leaves the rest unhurt, and any fragment in growing condition, if it combines both symbionts, can carry on the life of the plant, the constant renewal of gonidia preventing either decay or death. Barring accidents many lichens might exist as long as the world endures. G. Harmful Effect of Lichens One lichen only, Strigula complanata, a tropical species, has been proved to be truly and constantly parasitic. It grows on the surface of thick leathery leaves such as those of Camellia[967], etc. and the alga and fungus both penetrate the epidermis and burrow beneath the cuticle and outer cells, causing them to become brown. It undoubtedly injures the leaves. Friedrich[968] has given an isolated instance of the hold-fast hyphae of Usnea piercing through the cortex to the living tissue of the host, and not only destroying the middle lamella by absorption, but entering the cells. The Usnea plant was characterized by exceptionally vigorous growth. Practically all corticolous lichens are epiphytic and the injury they cause is of an accidental nature. Crustaceous species on the outer bark occupy the dead cortical layers and seem to be entirely harmless[969]. The larger foliose and fruticose forms are not so innocuous: by their abundant enveloping growth they hinder the entrance of air and moisture, and thus impede the life of the higher plant. Gleditsch[970], one of the earliest writers on Forestry, first indicated the possibly harmful effect of lichens especially on young trees and “in addition,” he says, “they serve as cover for large numbers of small insects which are hurtful in many ways to the trees.” Lindau[971] pointed out the damage done to pine-needles by Xanthoria parietina which grew round them like a cuff and probably choked the stomata, the leaves so clothed being mostly withered. Dufrenoy[972] states that he found the hyphae of a Parmelia entering a pine-needle
  • 60. by the stomata, and that the starch disappeared from the neighbouring parenchyma the cells of which tended to disintegrate. It is no uncommon sight to see neglected fruit trees with their branches crowded with various lichens, Evernia prunastri, Ramalina farinacea, etc. Such lichens often find the lenticels a convenient opening for their hold-fasts and exercise a smothering effect on the trees. Lilian Porter[973] distinctly states that Ramalinae by their penetrating bases damage the tissues of the trees. The presence of lichens is however generally due to unhealthy conditions already at work. Friedrich[974] reported of a forest which he examined, in which the atmospheric moisture was very high, with the soil water scarce, that those trees that were best supplied with soil water were free from lichens, while those with little water at the base bore dead branches which gave foothold to a rich growth of the epiphytes. Experiments to free fruit trees from their coating of lichens were made by Waite[975]. With a whitewash brush he painted over the infested branches with solutions of Bordeaux mixture of varying strength, and found that this solution, commonly in use as a fungicide, was entirely successful. The trees were washed down about the middle of March, and some three weeks later the lichens were all dead, the fruticose and foliose forms had changed in colour to a yellowish or brownish tint and were drooping and shrivelled. Waite was of opinion that the lichens did considerable damage to the trees, but it has been held by others that in very cold climates they may provide protection against severe frost. Instances of damage are however asserted by Bouly de Lesdain[976]. The bark of willows he found was a favourite habitat of numerous lichens: certain species, such as Xanthoria parietina, completely surrounded the branches, closing the stomata; others, such as Physcia ascendens, by the mechanical strain of the rhizoids, first wet and then dry, gradually loosened the outer bark and gave entry to fungi which completed the work of destruction. H. Gall-Formation Several instances of gall-formation to a limited extent have been already noted as caused by parasitic fungi or lichens. Greater abnormality of development is induced in a few species by the presence of minute animals, mites, wood-lice, etc. Zopf[977] noted these deformations of the thallus in specimens of Ramalina Kullensis collected on the coasts of Sweden. The fronds were frequently swollen in a sausage-like manner, and branching was hindered or altogether prevented; apothecia were rarely formed, though pycnidia were abundant. Here and there, on the swollen portions of the thallus, small holes could be detected and other larger openings of elliptical outline, about 1-1-1/2 mm. in diameter, the margins of which had a nibbled appearance. Three types of small articulated animals were found within the openings: species of mites, spiders and wood-lice. Mites were the most constant and
  • 61. were more or less abundant in all the deformations; frequently a minute Diplopodon belonging to the genus Polyxenus was also met with. Zopf came to the conclusion that the gall-formation was mainly due to the mites: they eat out the medulla and possibly through some chemical irritation excite the algal zone and cortex to more active growth, so that an extensive tangential development takes place. The small spiders may exercise the same power; evidently the larger holes were formed by them. Later Zopf added to gall-deformed plants Ramalina scopulorum var. incrassata and R. cuspidata var. crassa. He found in the hollow swollen fronds abundant evidence of mites, but whether identical with those that attacked R. Kullensis could not be determined. These two Ramalinae are maritime species; they are morphologically identical, as are also the deformed varieties, and the presence of mites, excreta, etc., are plainly visible in our British specimens. Bouly de Lesdain[978] found evidence of mite action in Ramalina farinacea collected from Pinus sylvestris on the dunes near Dunkirk. The cortex had been eaten off either by mites or by a small mollusc (Pupa muscorum) and the fronds had collapsed to a more or less convex compact mass. Somewhat similar deformations, though less pronounced, were observed in other Ramalinae. In Cladonia sylvatica and also in Cl. rangiformis Lesdain has indicated ff. abortiva Harm. as evidently the result of insect attack. In both cases the tips of the podetia are swollen, brown, bent and shrivelled. One of the most curious and constant effects, also worked out by Lesdain, occurs in Physcia hispida (Ph. stellaris var. tenella). In that lichen the gonidia at the tips of the fronds are scooped out and eaten by mites, so that the upper cortex becomes separated from the lower part of the thallus. As the hyphae of the cortex continue to develop, an arched hood is formed of a whitish shell-like appearance and powdery inside. Sometimes the mites penetrate at one point only, at other times the attack is at several places which may ultimately coalesce into one large cavity. In a crustaceous species, Caloplaca (Placodium) citrina he found constant evidence of the disturbing effect of the small creatures, which by their action caused the areolae of the thallus to grow into minute adherent squamules. A pathological variety, which he calls var. sorediosa, is distinguished by the presence of cup-like hollows which are scooped out by Acarinae and are filled by yellowish soredia. In another form, var. maritima, the margins of the areolae, occasionally the whole surface, become powdery with a citrine yellow efflorescence as a result of their nibbling. Zukal[979] adds to the deformations due to organic agents, the hypertrophies and abnormalities caused by climatic conditions. He finds such irregularities of structure more especially developed in countries with a very limited rainfall, as in certain districts of Chili, Australia and Africa, where changes in cortex and rhizoids and proliferations of the thallus testify to the disturbance of normal development.
  • 63. CHAPTER VII PHYLOGENY I. GENERAL STATEMENT A. Origin of Lichens Though lichens are very old members of the vegetable kingdom, as symbiotic plants they yet date necessarily from a time subsequent to the evolution of their component symbionts. Phylogeny of lichens begins with symbiosis. The algae, which belong to those families of Chlorophyceae and Myxophyceae that live on dry land, had become aerial before their association with fungi to form lichens. They must have been as fully developed then as now, since it is possible to refer them to the genus or sometimes even to the species of free-living forms. The fungus hyphae have combined with a considerable number of different algae, so that, even as regards the algal symbiont, lichens are truly polyphyletic in origin. The fungus is, however, the dominant partner, and the principal line of development must be traced through it, as it provides the reproductive organs of the plant. Representatives of two great groups of fungi are associated with lichens: Basidiomycetes, found in only a few genera, and Ascomycetes which form with the various algae the great bulk of lichen families. In respect of their fungal constituents lichens are also polyphyletic, and more especially in the Ascolichens which can be traced back to several starting points. But though lichens have no common origin, the manner of life is common to them all and has influenced them all in certain directions: they are fitted for a much longer existence than that of the fungi from which they started; and both the thallus and the fruiting bodies—at least in the sub- class Ascolichens—can persist through great climatic changes, and can pass unharmed through prolonged periods of latent or suspended vitality. Another striking note of similarity that runs through the members of this sub-class, with perhaps the exception of the gelatinous lichens, is the formation of lichen-acids which are excreted by the fungus. These substances are peculiar to lichens and go far to mark their autonomy. The production of the acids and the many changes evolved in the vegetative thallus suggest the great antiquity of lichens. B. Algal Ancestors It is unnecessary to look far for the algae as they have persisted through the ages in the same form both without and within the lichen thallus. By many early
  • 64. lichenologists the free-living algae, similar in type to lichen algae, were even supposed to be lichen gonidia in a depauperate condition and were, for that reason, termed by Wallroth “unfortunate brood-cells.” In the condition of symbiosis they may be considerably modified, but they revert to their normal form, and resume their normal life-history of spore production, etc., under suitable and free culture. The different algae taking part in lichen-formation have been treated in an earlier chapter[980]. C. Fungal Ancestors a. Hymenolichens. The problem of the fungal origin in this sub-class is comparatively simple. It contains but three genera of tropical lichens which are all associated with Myxophyceae, and the fungus in them, to judge from the form and habit of the plants, is a member of the Thelephoraceae. It may be that Hymenolichens are of comparatively recent origin and that the fungi belonging to the Basidiomycetes had, in the course of time, become less labile and less capable of originating a new method of existence. Whatever the reason, they lag immeasurably behind Ascomycetes in the formation of lichens. b. Ascolichens. Lichens are again polyphyletic within this sub-class. The main groups from which they are derived are evident. Whether there has been a series of origins within the different groups or a development from one starting point in each it would be difficult to determine. In any case great changes have taken place after symbiosis became established. The main divisions within the Ascolichens are related to fungi thus: Series 1. Pyrenocarpineae } to Pyrenomycetes. 2. Coniocarpineae } 3. Graphidineae to Hysteriaceae. 4. Cyclocarpineae to Discomycetes. II. THE REPRODUCTIVE ORGANS A. Theories of Descent in Ascolichens It has been suggested that ascomycetous fungi, from which Ascolichens are directly derived, are allied to the Florideae, owing to the appearance of a trichogyne in the carpogonium of both groups. That organ in the red seaweeds is a long delicate cell in direct communication with the egg-cell of the carpogonium. It is a structure adapted to totally submerged conditions, and fitted to attach the floating spermatia. In fungi there is also a structure considered as a trichogyne[981], which, in the Laboulbeniales, is a free, simple or branching organ. There is no other instance of
  • 65. any similar emergent cell or cells connected with the ascogonium of the Ascomycetes, though the term has been applied in these fungi to certain short hyphal branches from the ascogonium which remain embedded in the tissue. In the Ascomycetes examined all traces of emergent receptive organs, if they ever existed, have now disappeared; in some few there are possible internal survivals which never reach the surface. In Ascolichens, on the contrary, the “trichogyne,” a septate hyphal branch extending upwards from the ascogonium, and generally reaching the open, has been demonstrated in all the different groups except, as yet, in the Coniocarpineae which have not been investigated. Its presence is a strong point in the argument of those who believe in the Floridean ancestry of the Ascomycetes. It should be clearly borne in mind that Ascolichens are evolved from the Ascomycetes: these latter stand between them and any more remote ancestry. In the Ascomycetes, there is a recognized progression of development in the form of the sporophore from the closed perithecium of the Pyrenomycetes and possibly through the Hysteriaceae, which are partially closed, to the open ascocarp of the Discomycetes. If the fungal and lichenoid “trichogyne” is homologous with the carpogonial organ in the Florideae, then it must have been retained in all the groups of Ascomycetes as an emergent structure, and as such passed on from them to their lichen derivatives. Has that organ then disappeared from fungi since symbiosis began? There is no trace of it now, except as already stated in Laboulbeniales with which lichens are unconnected. Were Ascolichens monophyletic in origin, one could more easily suppose that both the fungal and lichen series might have started at some early stage from a common fungal ancestor possessing a well-developed trichogyne which has persisted in lichens, but has been reduced to insignificance in fungi, while fruit development proceeded on parallel lines in both. There is no evidence that such progression has taken place among lichens; the theory of a polyphyletic origin for the different series seems to be unassailable. At the same time, there is no evidence to show in which series symbiosis started first. It is more reasonable to accept the polyphyletic origin, as outlined above, from forms that had already lost the trichogyne, if they ever really possessed it, and to regard the lichen trichogyne as a new organ developing in lichens in response to some requirement of the deep-seated ascogonium. Its sexual function still awaits satisfactory proof, and it is wiser to withhold judgment as to the service it renders to the developing fruit. B. Relation of Lichens to Fungi a. Pyrenocarpineae. In Phycolichens (containing blue-green gonidia) and especially in the gelatinous forms, fructification is nearly always a more or less open apothecium. The general absence of the perithecial type is doubtless due to the gelatinous
  • 66. consistency of the vegetative structure; it is by the aid of moisture that the hymenial elements become turgid enough to secure the ejection of the spores through the narrow ostiole of the perithecium, and this process would be frustrated were the surrounding and enveloping thallus also gelatinous. There is only one minutely foliose or fruticose gelatinous family, the Pyrenidiaceae, in which Pyrenomycetes are established, and the gonidia, even though blue-green, have lost the gelatinous sheath and do not swell up. In Archilichens (with bright-green gonidia), perithecial fruits occur frequently; they are nearly always simple and solitary; in only a few families with a few representatives, is there any approach to the stroma formation so marked among fungi. The single perithecium is generally semi-immersed in the thallus. It may be completely surrounded by a hyphal “entire” wall, either soft and waxy or dark coloured and somewhat carbonaceous. In numerous species the outer protective wall covers only the upper portion that projects beyond the thallus, and such a perithecium is described as “dimidiate,” a type of fruit occurring in several genera, though rare among fungi. As to internal structure, there is a dissolution and disappearance of the paraphyses in some genera, their protective function not being so necessary in closed fruits, a character paralleled in fungi. There is a great variety of spore changes, from being minute, simple and colourless, to varied septation, general increase in size, and brown colouration. The different types may be traced to fungal ancestors with somewhat similar spores, but more generally they have developed within the lichen series. From the life of the individual it is possible to follow the course of evolution, and the spores of all species begin as simple, colourless bodies; in some genera they remain so, in others they undergo more or less change before reaching the final stage of colour or septation that marks the mature condition. As regards direct fungal ancestors, the Pyrenocarpineae, with solitary perithecia, are nearest in fruit structure to the Mycosphaerellaceae, in which family are included several fungus genera that are parasitic on lichens such as Ticothecium, Müllerella, etc. In that family occurs also the genus Stigmatea, in which the perithecia in form and structure are very similar to dimidiate Verrucariae. Zahlbruckner[982] has suggested as the starting point for the Verrucariaceae the fungus genus Verrucula. It was established by Steiner[983] to include two species, V. cahirensis and V. aegyptica, their perithecia being exactly similar to those of Verrucaria[984] in which genus they were originally placed. Both are parasitic on species of Caloplaca (Placodium). The former, on C. gilvella, transforms the host thallus to the appearance of a minutely lobed Placodium; the latter occupies an island-like area in the centre of the thallus of Caloplaca interveniens, and gives it, with its accompanying parasite, the character of an Endopyrenium (Dermatocarpon), while the rest of the thallus is normal and fertile.
  • 67. Zahlbruckner may have argued rightly, but it is also possible to regard these rare desert species as reversions from an originally symbiotic to a purely parasitic condition. Reinke came to the conclusion that if a parasitic species were derived directly from a lichen type, then it must still rank as a lichen, a view that has a direct bearing on the question. The parallel family of Pyrenulaceae which have Trentepohlia gonidia is considered by Zahlbruckner to have originated from the fungus genus Didymella. Compound or stromatoid fructifications occur once and again in lichen families; but, according to Wainio[985], there is no true stroma formation, only a pseudostroma resulting from adhesions and agglomerations of the thalline envelopes or from cohesions of the margins of developing fruit bodies. These pseudostromata are present in the genera Chiodecton and Glyphis (Graphidineae) and in Trypethelium, Mycoporium, etc. (Pyrenocarpineae). This view of the nature of the compound fruits is strengthened, as Wainio points out, by the presence in certain species of single apothecia or perithecia on the same specimen as the stromatoid fruits. b. Coniocarpineae. This subseries is entirely isolated. Its peculiarity lies in the character of the mature fruit in which the spores, owing to the early breaking down of the asci, lie as a loose mass in the hymenium, while dispersal is delayed for an indefinite time. This type of fruit, termed a mazaedium by Acharius, is in the form of a stalked or sessile roundish head—the capitulum—closed at first and only half-open at maturity rarely, as in Cyphelium, an exposed disc. There is a suggestion, but only a suggestion, of a similar fructification in the tropical fungus Camillea in which there is sometimes a stalk with one or more perithecia at the tip, and in some species early disintegration of the asci, leaving spore masses[986]. But neither in fungi nor in other lichens is there any obvious connection with Coniocarpineae. In some of the genera the fungus alone forms the stalk and the wall of the capitulum; in others the thallus shares in the fruit-formation growing around it as an amphithecium. The semi-closed fruits point to their affinity with Pyrenolichens, though they are more advanced than these judging from the thalline wall that is present in some genera and also from the half-open disc at maturity. The latter feature has influenced some systematists to classify the whole subseries among Cyclocarpineae. The thallus, as in Sphaerophorus, reaches a high degree of fruticose development; in other genera it is crustaceous without any formation of cortex, while in several genera or species it is non-existent, the fruits being parasites on the thalli of other lichens or saprophytes on dead wood, humus, etc. These latter—both parasites and saprophytes—are included by Rehm[987] and others among fungi, which has involved the breaking up of this very distinctive series. Rehm has thus published as Discomycetes the lichen genera Sphinctrina, Cyphelium, Coniocybe, Acolium, Calicium and Stenocybe, since some or all of their species are regarded by him as fungi.
  • 68. Reinke[988] in his lichen studies states that it might not be impossible for a saprophytic fungus to be derived from a crustaceous lichen—a case of reversion—but that no such instance was then known. More exact studies[989] of parasymbiosis and antagonistic symbiosis have shown the wide range of possible life-conditions, and such a reversion does not seem improbable. We must also bear in mind that in suitable cultures, lichen hyphae can be grown without gonidia: they develop in that case as saprophytes. On Reinke’s[988] view, however, that these saprophytic species, belonging to different genera in the Coniocarpineae, are true fungi, they would represent the direct and closely related ancestors of the corresponding lichen genera, giving a polyphyletic origin within this group. As fungus genera he has united them in Protocaliciaceae, and the representatives among fungi he distinguishes, as does Wainio[990], under such names as Mycocalicium and Mycoconiocybe. If we might consider the saprophytic forms as also retrogressive lichens, a monophyletic origin from some remote fungal ancestor would prove a more satisfactory solution of the inheritance problem. This view is even supported by a comparison Reinke himself has drawn between the development of the fructification in Mycocalicium parietinum, a saprophyte, and in his view a fungus, and Chaenotheca chrysocephala, a closely allied lichen. Both grow on old timber. In the former (the fungus), the mycelium pervades the outer weathered wood-cells, and the fruit stalk rises from a clump of brownish hyphae; there is no trace of gonidia. Chaenotheca chrysocephala differs in the presence of gonidia which are associated with the mycelium in scattered granular warts; but the fruit stalk here also rises directly from the mycelium between the granules. The presence of a lichen thallus chiefly differentiates between the two plants, and this thallus is not a casual or recent association; it is constant and of great antiquity as it is richly provided with lichen-acids. Reinke has indicated the course of evolution within the series but that is on the lines of thalline development and will be considered later. c. Graphidineae. This series contains a considerable variety of lichen forms, but all possess to a more or less marked degree the linear form of fructification termed a “lirella” which has only a slit-like opening. There is a tendency to round discoid fruits in the Roccellae and also in the Arthoniae; the apothecia of the latter, called by early lichenologists “ardellae,” are without margins. In nearly all there is a formation of carbonaceous black tissue either in the hypothecium or in the proper margins. In some of them the paraphyses are branched and dark at the tips, the branches interlocking to form a strong protective epithecium. There are, however, constant exceptions, in some particular, to any generalization in genera and in species. Müller- Argau’s[991] pronouncement might be held to have special reference to Graphidineae: “that in any genus, species or groups of species are to be found which outwardly shew something that is peculiar, though of slight importance.” The most
  • 69. constant type of gonidium is Trentepohlia, but Palmella and Phycopeltis occasionally occur. The spores are various in colour and form; they are rarely simple. The genus Arthonia is derived from a member of the Patellariaceae, from which family many of the Discomycetes have arisen. The course of development does not follow from a closed to an open fruit; the apothecium is open from the first, and growth proceeds from the centre outwards, the fertile cells gradually pushing aside the sterile tissue of the exterior. The affinity of Xylographa (with Palmella gonidia) is to be found in Stictis in the fungal family Stictidaceae, the apothecia of Stictis being at first closed, then open, and with a thick margin; Xylographa has a more elongate lirella fruit, though otherwise very similar, and has a very reduced thallus. Rehm[992] has classified Xylographa as a fungus. The genera with linear apothecia are closely connected with Hysteriaceae, and evidently inherit their fruit form severally from that family. There is thus ample evidence of polyphyletic descent in the series. Stromatoid fruits occur in Chiodectonaceae, with deeply sunk, almost closed disc, but they have evidently evolved within the series, possibly from a dividing up of the lirellae. In Graphidineae there are also forms, more especially in Arthoniaceae, on the border line between lichens and fungi: those with gonidia being classified as lichens, those without gonidia having been placed in corresponding genera of fungi. These latter athalline species live as parasites or saprophytes. The larger number of genera have a poorly developed thallus; in many of them it is embedded within the outer periderm-cells of trees, and is known as “hypophloeodal.” But in some families, such as Roccellaceae, the thallus attains a very advanced form and a very high production of acids. The conception of Graphidineae as a whole is puzzling, but one or other characteristic has brought the various members within the series. It is in this respect an epitome of the lichen class of which the different groups, with all their various origins and affinities, yet form a distinct and well-defined section of the vegetable kingdom. d. Cyclocarpineae. This is by far the largest series of lichens. The genera are associated with algae belonging both to the Myxophyceae and the Chlorophyceae, and from the many different combinations are produced great variations in the form of the vegetative body. The fruit is an emergent, round or roundish disc or open apothecium in all the members of the series except Pertusariaceae, where it is partially immersed in thalline “warts.” In its most primitive form, described as “biatorine” or “lecideine,” it may be soft and waxy (Biatora) or hard and carbonaceous (Lecidea), in the latter the paraphyses being mostly coloured at the tips; these are either simple or but sparingly branched, so that the epithecium is a comparatively slight structure. The outer sterile tissue forms a protective wall or “proper margin” which may be entirely pushed aside, but generally persists as a distinct rim round the disc.
  • 70. A great advance within the series arose when the gonidial elements of the thallus took part in fruit-formation. In that case not only is the hymenium generally subtended by a layer of algae, but thalline tissue containing algae grows up around the fruit, and forms a second wall or thalline margin. This type of apothecium, termed “lecanorine,” is thus intimately associated with the assimilating tissue and food supply, and it gains in capacity of ascus renewal and of long duration. This development from non-marginate to marginate ascomata is necessarily an accompaniment of symbiosis. There is no doubt that the Cyclocarpineae derive from some simple form or forms of Discomycete in the Patellariaceae. The relationship between that family and the lower Lecideae is very close. Rehm[993] finds the direct ancestors of Lecidea itself in the fungus genus, Patinella, in which the apothecia are truly lecideine in character— open, flat and slightly margined, the hypothecium nearly always dark-coloured and the paraphyses branched, septate, clavate and coloured at the tips, forming a dark epithecium. More definitely still he describes Patinella atroviridis, a new species he discovered, as in all respects a Lecidea, but without gonidia. In the crustaceous Lecideaceae, a number of genera have been delimited on spore characters—colourless or brown, and simple or variously septate. In Patellariaceae as described by Rehm are included a number of fungus genera which correspond to these lichen genera. Only two of them—Patinella and Patellaria—are saprophytic; in all the other genera of the family, the species with very few exceptions are parasitic on lichens: they are parasymbionts sharing the algal food supply; in any case, they thrive on a symbiotic thallus. Rehm unhesitatingly derives the corresponding lichen genera from these fungi. He takes no account of the difficulty that if these parasitic (or saprophytic) fungi are primitive, they have yet appeared either later in time than the lichens on which they exist, or else in the course of ages they have entirely changed their substratum. He has traced, for instance, the lichen, Buellia, to a saprophytic fungus species, Karschia lignyota, to a genus therefore in which most of the species are parasitic on lichens and have generally been classified as parasitic lichens. There is no advance in apothecial characters from the fungus, Karschia, to Buellia, merely the change to symbiosis. It therefore seems more in accordance with facts to regard Buellia as a genus evolved within the lichen series from Patinella through Lecidea, and to accept these species of Karschia on the border line as parasitic, or even as saprophytic, reversions from the lichen status. We may add that while these brown-spored lichens are fairly abundant, the corresponding athalline or fungus forms are comparatively few in number, which is exactly what might be expected from plants with a reversionary history. Occasionally in biatorine or lecideine species with a slight thalline development all traces of the thallus disappear after the fructification has reached maturity. The apothecia, if on wood or humus, appear to be saprophytic and would at first sight be
  • 71. classified as fungi. They have undoubtedly retained the capacity to live at certain stages, or in certain conditions, as saprophytes. The thallus disappears also in some species of the crustaceous genera that possess apothecia with a thalline margin, and the fruits may be left stranded and solitary on the normal substratum, or on some neighbouring lichen thallus where they are more or less parasitic; but as the thalline margin persists, there has been no question as to their nature and affinity. Rehm suggests that many species now included among lichens may be ultimately proved to be fungi; but it is equally possible that the reverse may be the case, as for instance Bacidia flavovirescens, held by Rehm and others to be a parasitic fungus species, but since proved by Tobler[994] to be a true lichen. A note by Lightfoot[995], one of our old-time botanists who gave lichens a considerable place in his Flora, foreshadows the theory of evolution by gradual advance, and his views offer a suggestive commentary on the subject under discussion. He was debating the systematic position of the maritime lichen genus Lichina, considered then a kind of Fucus, and had observed its similarity with true lichens. “The cavity,” he writes, “at the top of the fructification (in Lichina) is a proof how nearly this species of Fucus is related to the scutellated lichens. Nature disdains to be limited to the systematic rules of human invention. She never makes any sudden starts from one class or genus to another, but is regularly progressive in all her works, uniting the various links in the chain of beings by insensible connexions.” III. THE THALLUS A. General Outline of Development a. Preliminary Considerations. The evolution of lichens, as such, has reference mainly to the thallus. Certain developments of the fructification are evident, but the changes in the reproductive organs have not kept pace with those of the vegetative structures: the highest type of fruit, for instance, the apothecium with a thalline margin, occurs in genera and species with a very primitive vegetative structure as well as in those that have attained higher development. Lichens are polyphyletic as regards their algal, as well as their fungal, ancestors, so that it is impossible to indicate a straight line of progression, but there is a general process of thalline development which appears once and again in the different phyla. That process, from simpler to more complicated forms, follows on two lines: on the one there is the endeavour to increase the assimilating surface, on the other the tendency to free the plant from the substratum. In both, the aim has been the same, to secure more favourable conditions for assimilation and aeration. Changes in structure have been already described[996], and it is only needful to indicate here the main lines of evolution.
  • 72. b. Course of Evolution in Hymenolichens. There is but little trace of development in these lichens. The fungus has retained more or less the form of the ancestral Thelephora which has a wide-spreading superficial basidiosporous hymenium. Three genera have been recognized, the differences between them being due to the position within the thallus, and the form of the Scytonema that constitutes the gonidium. The highest stage of development and of outward form is reached in Cora, in which the gonidial zone is central in the tissue and is bounded above and below by strata of hyphae. c. Course of Evolution in Ascolichens. It is in the association with Ascomycetes that evolution and adaptation have had full scope. In that sub-class there are four constantly recurring and well-marked stages of thalline development. (1) The earliest, most primitive stage, is the crustaceous: at first an accretion of separate granules which may finally be united into a continuous crust with a protective covering of thick-walled amorphous hyphae forming a “decomposed” cortex. The extension of a granule by growth in one direction upwards and outwards gives detachment from the substratum, and originates (2) the squamule which is, however, often of primitive structure and attached to the support, like the granule, by the medullary hyphae. Further growth of the squamule results in (3) the foliose thallus with all the adaptations of structure peculiar to that form. In all of these, the principal area of growth is round the free edges of the thallus. A greater change takes place in the advance to (4) the fruticose type in which the more active growing tissue is restricted to the apex, and in which the frond or filament adheres at one point only to the support, a new series of strengthening and other structures being evolved at the same time. The lichen fungi associate, as has been already stated, with two different types of algae: those combined with the Myxophyceae have been designated Phycolichenes, those with Chlorophyceae as Archilichenes. The latter predominate, not only in the number of lichens, but also in the more varied advance of the thallus, although, in many instances, genera and species of both series may be closely related. B. Comparative Antiquity of Algal Symbionts One of the first questions of inheritance concerns the comparative antiquity of the two gonidial series: with which kind of alga did the fungus first form the symbiotic relationship? No assistance in solving the problem is afforded by the type of fructification. The fungus in Archilichens is frequently one of the more primitive Pyrenomycetes, though more often a Discomycete, while in Phycolichens Pyrenomycetes are very rare. There is, as already stated, no correlation of advance between the fruit and the thallus, as the most highly evolved apothecia with well- formed thalline margins are constantly combined with thalli of low type. Forssell[997] gave considerable attention to the question of antiquity in his study of gelatinous crustaceous lichens in the family Pyrenopsidaceae, termed by him
  • 73. Gloeolichens, and he came to the conclusion that Archilichens represented the older combination, Phycolichens being comparatively young. His view is based on a study of the development of certain lichen fungi that seem able to adapt themselves to either kind of algal symbiont. He found[997] in Euopsis (Pyrenopsis) granatina, one of the Pyrenopsidaceae, that certain portions of the thallus contained blue-green algae, while others contained Palmella, and that these latter, though retrograde in development, might become fertile. The granules with blue-green gonidia were stronger, more healthy and capable of displacing those with Palmella, but not of bearing apothecia, though spermogonia were embedded in them —a first step, according to Forssell, towards the formation of apothecia. These granules, not having reached a fruiting stage, were reckoned to be of a more recent type than those associated with Palmella. In other instances, however, the line of evolution has been undoubtedly from blue-green to more highly evolved bright-green thalli. The striking case of similarity between Psoroma hypnorum (bright-green) and Pannaria rubiginosa (blue-green) may also be adduced. Forssell considers that Psoroma is the more ancient form, but as the fungus is adapted to associate with either kind of alga, the type of squamules forming the thallus may be gradually transformed by the substitution of blue-green for the earlier bright-green—the Pannaria superseding the Psoroma. There is a close resemblance in the fructification —that is of the fungus—in these two different lichens. Hue[998] shares Forssell’s opinion as to the greater antiquity of the bright-green gonidia and cites the case of Solorina crocea. In that lichen there is a layer of bright- green gonidia in the usual dorsiventral position, below the upper cortex. Below this zone there is a second formed entirely of blue-green cells. Hue proved by his study of development in Solorina that the bright-green were the normal gonidia of the thallus, and were the only ones present in the growing peripheral areas; the blue- green were a later addition, and appeared first in small groups at some distance from the edge of the lobes. The whole subject of cephalodia-development[999] has a bearing on this question. These bodies always contain blue-green algae, and are always associated with Archilichens. Mostly they occur as excrescences, as in Stereocaulon and in Peltigera. The fungus of the host-lichen though normally adapted to bright-green algae has the added capacity of forming later a symbiosis with the blue-green. This tendency generally pervades a whole genus or family, the members of which, as in Peltigeraceae, are too closely related to allow as a rule of separate classification even when the algae are totally distinct. C. Evolution of Phycolichens
  • 74. The association of lichen-forming fungi with blue-green algae may have taken place later in time, or may have been less successful than with the bright-green: they are fewer in number, and the blue-green type of thallus is less highly evolved, though examples of very considerable development are to be found in such genera as Peltigera, Sticta or Nephromium. a. Gloeolichens. Among crustaceous forms the thallus is generally elementary, more especially in the Gloeolichens (Pyrenopsidaceae). The algae of that family, Gloeocapsa, Xanthocapsa or Chroococcus, are furnished with broad gelatinous sheaths which, in the lichenoid state, are penetrated and traversed by the fungal filaments, a branch hypha generally touching with its tip the algal cell-wall. Under the influence of symbiosis, the algal masses become firmer and more compact, without much alteration in form; algae entirely free from hyphae are often intermingled with the others. Even among Gloeolichens there are signs of advancing development both in the internal structure and in outward form. Lobes free from the substratum, though very minute, appear in the genus Paulia, the single species of which comes from Polynesia. Much larger lobes are characteristic of Thyrea, a Mediterranean and American genus. The fruticose type, with upright fronds of minute size, also appears in our native genus Synalissa. It is still more marked in the coralloid thalli of Peccania and Phleopeccania. In most of these genera there is also a distinct tendency to differentiation of tissues, with the gonidia congregating towards the better lighted surfaces. The only cortex formation occurs in the crustaceous genus Forssellia in which, according to Zahlbruckner[1000], it is plectenchymatous above, the thallus being attached below by hyphae penetrating the substratum. In another genus, Anema[1001], which is minutely lobate-crustaceous, the internal hyphae form a cellular network in which the algae are immeshed. As regards algal symbionts, the members of this family are polyphyletic in origin. b. Ephebaceae and Collemaceae. In Ephebaceae the algae are tufted and filamentous, Scytonema, Stigonema or Rivularia, the trichomes of which are surrounded by a common gelatinous sheath. The hyphae travel in the sheath alongside the cell-rows, and the symbiotic plant retains the tufted form of the alga as in Lichina with Rivularia, Leptogidium with Scytonema, and Ephebe with Stigonema. The last named lichen forms a tangle of intricate branching filaments about an inch or more in length. The fruticose habit in these plants is an algal characteristic; it has not been acquired as a result of symbiosis, and does not signify any advance in evolution. A plectenchymatous cortex marks some progress here also in Leptodendriscum, Leptogidium and Polychidium, all of which are associated with Scytonema. These genera may well be derived from an elementary form such as Thermutis. They differ from each other in spore characters, etc., Polychidium being the most highly developed with its cortex of two cell-rows and with two-celled spores. Nostoc forms the gonidium of Collemaceae. In its free state it is extremely gelatinous and transmits that character more or less to the lichen. In the crustaceous genus Physma, which forms the base of the Collema group or phylum, there is but
  • 75. little difference in form between the thalline warts of the lichen crust and the original small Nostoc colonies such as are to be found on damp mosses, etc. In Collema itself, the less advanced species are scarcely more than crusts, though the more developed show considerable diversity of lobes, either short and pulpy, or spreading out in a thin membrane. The Nostoc chains pervade the homoiomerous thallus, but in some species they lie more towards the upper surface. There is no cortex, though once and again plectenchyma appears in the apothecial margin, both in this genus and in Leprocollema which is purely crustaceous. Leptogium is a higher type than Collema, the thallus being distinguished by its cellular cortex. The tips of the hyphae, lying close together at the surface, are cut off by one or more septa, giving a one- or several-celled cortical layer. The species though generally homoiomerous are of thinner texture and are less gelatinous than those of Collema. c. Pyrenidiaceae. This small family of pyrenocarpous Phycolichens may be considered here though its affinity, through the form of the fruiting body, is with Archilichens. The gonidia are species of Nostoc, Scytonema and Stigonema. There are only five genera; one of these, Eolichen, contains three species, the others are monotypic. The crustaceous genera have a non-corticate thallus, but an advance to lobate form takes place in Placothelium, an African genus. The two genera that show most development are both British: Coriscium (Normandina), which is lobate, heteromerous and corticate—though always sterile—and Pyrenidium which is fruticose in habit; the latter is associated with Nostoc and forms a minute sward of upright fronds, corticate all round; the perithecium is provided with an entire wall and is immersed in the thallus. If the thallus alone were under consideration these lichens would rank with Pannariaceae. d. Heppiaceae and Pannariaceae. The next stage in the development of Phycolichens takes place through the algae, Scytonema and Nostoc, losing not only their gelatinous sheaths, but also, to a large extent, their characteristic forms. Chains of cells can frequently be observed, but accurate and certain identification of the algal genus is only possible by making separate cultures of the gonidia. Scytonema forms the gonidium of the squamulose Heppiaceae consisting of the single genus Heppia. The ground tissue of the species is either wholly of plectenchyma with algae in the interstices, or the centre is occupied by a narrow medulla of loose filaments. In the allied family Pannariaceae, a number of genera contain Scytonema or Nostoc, while two, Psoroma and Psoromaria, have bright-green gonidia. The thallus varies from crustaceous or minutely squamulose, to lobes of fair dimension in Parmeliella and in Hydrothyria venosa, an aquatic lichen. Plectenchyma appears in
  • 76. the upper cortex of both of these, and in the proper margin of the apothecia, while the under surface is frequently provided with rhizoidal filaments. These two families form a transition between the gelatinous, and mostly homoiomerous thallus, and the more developed entirely heteromerous thallus of much more advanced structure. The fructification in all of them, gelatinous and non- gelatinous, is a more or less open apothecium, sometimes immarginate, and biatorine or lecideine, but often, even in species nearly related to these, it is lecanorine with a thalline amphithecium. Rarely are the sporiferous bodies sunk in the tissue, with a pseudo-perithecium, as in Phylliscum. It would be difficult to trace advance in all this group on the lines of fruit development. The two genera with bright-green gonidia, Psoroma and Psoromaria, have been included in Pannariaceae owing to the very close affinity of Psoroma hypnorum with Pannaria rubiginosa; they are alike in every respect except in their gonidia. Psoromaria is exactly like Psoroma, but with immarginate biatorine apothecia, representing therefore a lower development in that respect. These lichens not only mark the transition from gelatinous to non-gelatinous forms, but in some of them there is an interchange of gonidia. The progression in the phylum or phyla has evidently been from blue-green up to some highly evolved forms with bright-green algae, though there may have been, at the beginning, a substitution of blue-green in place of earlier bright-green algae, Phycolichens usurping as it were the Archilichen condition. e. Peltigeraceae and Stictaceae. The two families just examined marked a great advance which culminated in the lobate aquatic lichen Hydrothyria. This lichen, as Sturgis pointed out, shows affinity with other Pannariaceae in the structure of the single large-celled cortical layer as well as with species of Nephroma (Peltigeraceae). A still closer affinity may be traced with Peltigera in the presence in both plants of veins on the under surface. The capacity of Peltigera species to grow in damp situations may also be inherited from a form like the submerged Hydrothyria. In both families there are transitions from blue-green to bright-green gonidia, or vice versa, in related species. Thus in Peltigeraceae we find Peltigera containing Nostoc in the gonidial zone, with Peltidea which may be regarded as a separate genus, or more naturally as a section of Peltigera; it contains bright-green gonidia, but has cephalodia containing Nostoc associated with its thallus. The genus Nephroma is similarly divided into species with a bright-green gonidial zone, chiefly Arctic or Antarctic in distribution, and species with Nostoc (subgenus Nephromium) more numerous and more widely distributed. Peltigera and Nephroma are also closely related in the character of the fructification. It is a flat non-marginate disc borne on the edge of the thallus: in Peltigera on the upper surface, in Nephroma on the under surface. The remaining genus Solorina contains normally a layer of bright-green algae, but, along with these, there are always present more or fewer Nostoc cells, either in a thin layer as in S.
  • 77. Welcome to Our Bookstore - The Ultimate Destination for Book Lovers Are you passionate about books and eager to explore new worlds of knowledge? At our website, we offer a vast collection of books that cater to every interest and age group. From classic literature to specialized publications, self-help books, and children’s stories, we have it all! Each book is a gateway to new adventures, helping you expand your knowledge and nourish your soul Experience Convenient and Enjoyable Book Shopping Our website is more than just an online bookstore—it’s a bridge connecting readers to the timeless values of culture and wisdom. With a sleek and user-friendly interface and a smart search system, you can find your favorite books quickly and easily. Enjoy special promotions, fast home delivery, and a seamless shopping experience that saves you time and enhances your love for reading. Let us accompany you on the journey of exploring knowledge and personal growth! ebookgate.com