100% found this document useful (1 vote)
5 views45 pages

(eBook PDF) Practice of Computing Using Python, The 3rd Edition instant download

The document provides information about various eBooks available for download, including titles related to Python programming, nursing practice, and public speaking. It highlights the 3rd edition of 'Practice of Computing Using Python' among other educational resources. Links to each eBook are included for instant access.

Uploaded by

smhrqzrs200
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
5 views45 pages

(eBook PDF) Practice of Computing Using Python, The 3rd Edition instant download

The document provides information about various eBooks available for download, including titles related to Python programming, nursing practice, and public speaking. It highlights the 3rd edition of 'Practice of Computing Using Python' among other educational resources. Links to each eBook are included for instant access.

Uploaded by

smhrqzrs200
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

(eBook PDF) Practice of Computing Using Python,

The 3rd Edition install download

https://ebooksecure.com/product/ebook-pdf-practice-of-computing-
using-python-the-3rd-edition/

Download more ebook instantly today at https://ebooksecure.com


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

(eBook PDF) Introduction to Programming Using Python An


1

http://ebooksecure.com/product/ebook-pdf-introduction-to-
programming-using-python-an-1/

(eBook PDF) Numerical Analysis: Mathematics of


Scientific Computing 3rd

http://ebooksecure.com/product/ebook-pdf-numerical-analysis-
mathematics-of-scientific-computing-3rd/

(eBook PDF) The Practice of Creative Writings 3rd


Edition

http://ebooksecure.com/product/ebook-pdf-the-practice-of-
creative-writings-3rd-edition/

The Physics of Computing 1st Edition Marilyn Wolf -


eBook PDF

https://ebooksecure.com/download/the-physics-of-computing-ebook-
pdf/
(eBook PDF) The Doctor of Nursing Practice Essentials
3rd Edition

http://ebooksecure.com/product/ebook-pdf-the-doctor-of-nursing-
practice-essentials-3rd-edition/

(eBook PDF) Python Programming in Context 3rd Edition

http://ebooksecure.com/product/ebook-pdf-python-programming-in-
context-3rd-edition/

Python Programming in Context, 3rd Edition (eBook PDF)

http://ebooksecure.com/product/python-programming-in-context-3rd-
edition-ebook-pdf/

(eBook PDF) The Speaker: The Tradition and Practice of


Public Speaking 3rd

http://ebooksecure.com/product/ebook-pdf-the-speaker-the-
tradition-and-practice-of-public-speaking-3rd/

(eBook PDF) The Nurse, The Math, The Meds: Drug


Calculations Using Dimensional Analysis 3rd Edition

http://ebooksecure.com/product/ebook-pdf-the-nurse-the-math-the-
meds-drug-calculations-using-dimensional-analysis-3rd-edition/
THE PRACTICE OF COMPUTING USING

3RD EDITION

WILLIAM RICHARD
PUNCH • ENBODY
C O N T E N T S

VIDEONOTES xxiv
PREFACE xxv
PREFACE TO THE SECOND EDITION xxix
1.0.1 Data Manipulation xxx
1.0.2 Problem Solving and Case Studies xxx
1.0.3 Code Examples xxx
1.0.4 Interactive Sessions xxxi
1.0.5 Exercises and Programming Projects xxxi
1.0.6 Self-Test Exercises xxxi
1.0.7 Programming Tips xxxi

PART 1 THINKING ABOUT COMPUTING 1


Chapter 0 The Study of Computer Science 3
0.1 Why Computer Science? 3
0.1.1 Importance of Computer Science 3
0.1.2 Computer Science Around You 4
0.1.3 Computer “Science” 4
0.1.4 Computer Science Through Computer Programming 6
0.2 The Difficulty and Promise of Programming 6
0.2.1 Difficulty 1: Two Things at Once 6
0.2.2 Difficulty 2: What Is a Good Program? 9
0.2.3 The Promise of a Computer Program 10
0.3 Choosing a Computer Language 11
0.3.1 Different Computer Languages 11
0.3.2 Why Python? 11
0.3.3 Is Python the Best Language? 13
0.4 What Is Computation? 13
0.5 What Is a Computer? 13

vii
viii CONTENTS

0.5.1 Computation in Nature 14


0.5.2 The Human Computer 17
0.6 The Modern, Electronic Computer 18
0.6.1 It’s the Switch! 18
0.6.2 The Transistor 19
0.7 A High-Level Look at a Modern Computer 24
0.8 Representing Data 26
0.8.1 Binary Data 26
0.8.2 Working with Binary 27
0.8.3 Limits 28
0.8.4 Representing Letters 29
0.8.5 Representing Other Data 30
0.8.6 What Does a Number Represent? 31
0.8.7 How to Talk About Quantities of Data 32
0.8.8 How Much Data Is That? 32
0.9 Overview of Coming Chapters 34

P A R T 2 S TA RT I N G T O P R O G R A M 35
Chapter 1 Beginnings 37
1.1 Practice, Practice, Practice 37
1.2 QuickStart, the Circumference Program 38
1.2.1 Examining the Code 40
1.3 An Interactive Session 42
1.4 Parts of a Program 43
1.4.1 Modules 43
1.4.2 Statements and Expressions 43
1.4.3 Whitespace 45
1.4.4 Comments 46
1.4.5 Special Python Elements: Tokens 46
1.4.6 Naming Objects 48
1.4.7 Recommendations on Naming 49
1.5 Variables 49
1.5.1 Variable Creation and Assignment 50
1.6 Objects and Types 53
1.6.1 Numbers 55
1.6.2 Other Built-In Types 57
1.6.3 Object Types: Not Variable Types 58
1.6.4 Constructing New Values 60
CONTENTS ix

1.7 Operators 61
1.7.1 Integer Operators 61
1.7.2 Floating-Point Operators 64
1.7.3 Mixed Operations 64
1.7.4 Order of Operations and Parentheses 65
1.7.5 Augmented Assignment Operators: A Shortcut! 66
1.8 Your First Module, Math 68
1.9 Developing an Algorithm 69
1.9.1 New Rule—Testing 73
1.10 Visual Vignette: Turtle Graphics 74
1.11 What’s Wrong with My Code? 75
Chapter 2 Control 87
2.1 QuickStart Control 87
2.1.1 Selection 87
2.1.2 Booleans for Decisions 89
2.1.3 The if Statement 89
2.1.4 Example: What Lead Is Safe in Basketball? 92
2.1.5 Repetition 96
2.1.6 Example: Finding Perfect Numbers 100
2.1.7 Example: Classifying Numbers 105
2.2 In-Depth Control 109
2.2.1 True and False: Booleans 109
2.2.2 Boolean Variables 110
2.2.3 Relational Operators 110
2.2.4 Boolean Operators 115
2.2.5 Precedence 116
2.2.6 Boolean Operators Example 117
2.2.7 Another Word on Assignments 120
2.2.8 The Selection Statement for Decisions 122
2.2.9 More on Python Decision Statements 122
2.2.10 Repetition: the while Statement 126
2.2.11 Sentinel Loop 136
2.2.12 Summary of Repetition 136
2.2.13 More on the for Statement 137
2.2.14 Nesting 140
2.2.15 Hailstone Sequence Example 142
2.3 Visual Vignette: Plotting Data with Pylab 143
2.3.1 First Plot and Using a List 144
2.3.2 More Interesting Plot: A Sine Wave 145
x CONTENTS

2.4 Computer Science Perspectives: Minimal Universal Computing 147


2.4.1 Minimal Universal Computing 147
2.5 What’s Wrong with My Code? 148
Chapter 3 Algorithms and Program Development 161
3.1 What Is an Algorithm? 161
3.1.1 Example Algorithms 162
3.2 Algorithm Features 163
3.2.1 Algorithm versus Program 163
3.2.2 Qualities of an Algorithm 165
3.2.3 Can We Really Do All That? 167
3.3 What Is a Program? 167
3.3.1 Readability 167
3.3.2 Robust 171
3.3.3 Correctness 172
3.4 Strategies for Program Design 173
3.4.1 Engage and Commit 173
3.4.2 Understand, Then Visualize 174
3.4.3 Think Before You Program 175
3.4.4 Experiment 175
3.4.5 Simplify 175
3.4.6 Stop and Think 177
3.4.7 Relax: Give Yourself a Break 177
3.5 A Simple Example 177
3.5.1 Build the Skeleton 178
3.5.2 Output 178
3.5.3 Input 179
3.5.4 Doing the Calculation 181

P A R T 3 D AT A S T R U C T U R E S A N D F U N C T I O N S 187
Chapter 4 Working with Strings 189
4.1 The String Type 190
4.1.1 The Triple-Quote String 190
4.1.2 Nonprinting Characters 191
4.1.3 String Representation 191
4.1.4 Strings as a Sequence 192
4.1.5 More Indexing and Slicing 193
4.1.6 Strings Are Iterable 198
CONTENTS xi

4.2 String Operations 199


4.2.1 Concatenation (+) and Repetition (*) 199
4.2.2 Determining When + Indicates Addition or
Concatenation? 200
4.2.3 Comparison Operators 201
4.2.4 The in Operator 202
4.2.5 String Collections Are Immutable 203
4.3 A Preview of Functions and Methods 205
4.3.1 A String Method 205
4.3.2 Determining Method Names and Method Arguments 208
4.3.3 String Methods 210
4.3.4 String Functions 210
4.4 Formatted Output for Strings 211
4.4.1 Descriptor Codes 212
4.4.2 Width and Alignment Descriptors 213
4.4.3 Floating-Point Precision Descriptor 214
4.5 Control and Strings 215
4.6 Working with Strings 218
4.6.1 Example: Reordering a Person’s Name 218
4.6.2 Palindromes 220
4.7 More String Formatting 223
4.8 Unicode 226
4.9 A GUI to Check a Palindrome 228
4.10 What’s Wrong with My Code? 232
Chapter 5 Functions—QuickStart 245
5.1 What Is a Function? 245
5.1.1 Why Have Functions? 246
5.2 Python Functions 247
5.3 Flow of Control with Functions 250
5.3.1 Function Flow in Detail 251
5.3.2 Parameter Passing 251
5.3.3 Another Function Example 253
5.3.4 Function Example: Area of a Triangle 254
5.3.5 Functions Calling Functions 258
5.3.6 When to Use a Function 259
5.3.7 What If There Is No Return Statement? 260
5.3.8 What If There Are Multiple Return Statements? 260
xii CONTENTS

5.4 Visual Vignette: Turtle Flag 261


5.5 What’s Wrong with My Code? 262
Chapter 6 Files and Exceptions I 271
6.1 What Is a File? 271
6.2 Accessing Files: Reading Text Files 271
6.2.1 What’s Really Happening? 272
6.3 Accessing Files: Writing Text Files 273
6.4 Reading and Writing Text Files in a Program 274
6.5 File Creation and Overwriting 275
6.5.1 Files and Functions Example: Word Puzzle 276
6.6 First Cut, Handling Errors 282
6.6.1 Error Names 283
6.6.2 The try-except Construct 283
6.6.3 try-except Flow of Control 284
6.6.4 Exception Example 285
6.7 Example: Counting Poker Hands 288
6.7.1 Program to Count Poker Hands 291
6.8 GUI to Count Poker Hands 299
6.8.1 Count Hands Function 300
6.8.2 The Rest of the GUI Code 302
6.9 Error Check Float Input 304
6.10 What’s Wrong with My Code? 304
Chapter 7 Lists and Tuples 311
7.1 What Is a List? 311
7.2 What You Already Know How To Do With Lists 313
7.2.1 Indexing and Slicing 314
7.2.2 Operators 315
7.2.3 Functions 317
7.2.4 List Iteration 318
7.3 Lists Are Different than Strings 319
7.3.1 Lists Are Mutable 319
7.3.2 List Methods 320
7.4 Old and New Friends: Split and Other Functions and Methods 325
7.4.1 Split and Multiple Assignment 325
7.4.2 List to String and Back Again, Using join 326
7.4.3 The Sorted Function 327
CONTENTS xiii

7.5 Working with Some Examples 328


7.5.1 Anagrams 328
7.5.2 Example: File Analysis 334
7.6 Mutable Objects and References 340
7.6.1 Shallow versus Deep Copy 345
7.6.2 Mutable versus Immutable 349
7.7 Tuples 350
7.7.1 Tuples from Lists 352
7.7.2 Why Tuples? 353
7.8 Lists: The Data Structure 353
7.8.1 Example Data Structure 354
7.8.2 Other Example Data Structures 355
7.9 Algorithm Example: U.S. EPA Automobile Mileage Data 355
7.9.1 CSV Module 365
7.10 Visual Vignette: Plotting EPA Data 366
7.11 List Comprehension 368
7.11.1 Comprehensions, Expressions, and the Ternary
Operator 370
7.12 Visual Vignette: More Plotting 370
7.12.1 Pylab Arrays 371
7.12.2 Plotting Trigonometric Functions 373
7.13 GUI to Find Anagrams 374
7.13.1 Function Model 374
7.13.2 Controller 375
7.14 What’s Wrong with My Code? 377
Chapter 8 More on Functions 395
8.1 Scope 395
8.1.1 Arguments, Parameters, and Namespaces 397
8.1.2 Passing Mutable Objects 399
8.1.3 Returning a Complex Object 401
8.1.4 Refactoring evens 403
8.2 Default Values and Parameters as Keywords 404
8.2.1 Example: Default Values and Parameter Keywords 405
8.3 Functions as Objects 407
8.3.1 Function Annotations 408
8.3.2 Docstrings 409
xiv CONTENTS

8.4 Example: Determining a Final Grade 410


8.4.1 The Data 410
8.4.2 The Design 410
8.4.3 Function: weighted_grade 411
8.4.4 Function: parse_line 411
8.4.5 Function: main 412
8.4.6 Example Use 413
8.5 Pass “by Value” or “by Reference” 413
8.6 What’s Wrong with My Code? 414
Chapter 9 Dictionaries and Sets 423
9.1 Dictionaries 423
9.1.1 Dictionary Example 424
9.1.2 Python Dictionaries 425
9.1.3 Dictionary Indexing and Assignment 425
9.1.4 Operators 426
9.1.5 Ordered Dictionaries 431
9.2 Word Count Example 432
9.2.1 Count Words in a String 432
9.2.2 Word Frequency for Gettysburg Address 433
9.2.3 Output and Comments 437
9.3 Periodic Table Example 438
9.3.1 Working with CSV Files 439
9.3.2 Algorithm Overview 441
9.3.3 Functions for Divide and Conquer 441
9.4 Sets 445
9.4.1 History 445
9.4.2 What’s in a Set? 445
9.4.3 Python Sets 446
9.4.4 Methods, Operators, and Functions for Python Sets 447
9.4.5 Set Methods 447
9.5 Set Applications 452
9.5.1 Relationship between Words of Different 452
9.5.2 Output and Comments 456
9.6 Scope: The Full Story 456
9.6.1 Namespaces and Scope 457
9.6.2 Search Rule for Scope 457
9.6.3 Local 457
9.6.4 Global 458
9.6.5 Built-Ins 462
9.6.6 Enclosed 463
CONTENTS xv

9.7 Using zip to Create Dictionaries 464


9.8 Dictionary and Set Comprehensions 465
9.9 Visual Vignette: Bar Graph of Word Frequency 466
9.9.1 Getting the Data Right 466
9.9.2 Labels and the xticks Command 467
9.9.3 Plotting 467
9.10 GUI to Compare Files 468
9.10.1 Controller and View 469
9.10.2 Function Model 471
9.11 What’s Wrong with My Code? 473
Chapter 10 More Program Development 483
10.1 Introduction 483
10.2 Divide and Conquer 483
10.2.1 Top-Down Refinement 484
10.3 The Breast Cancer Classifier 484
10.3.1 The Problem 484
10.3.2 The Approach: Classification 485
10.3.3 Training and Testing the Classifier 485
10.3.4 Building the Classifier 485
10.4 Designing the Classifier Algorithm 487
10.4.1 Divided, now Conquer 490
10.4.2 Data Structures 491
10.4.3 File Format 491
10.4.4 The make_training_set Function 492
10.4.5 The make_test_set Function 496
10.4.6 The train_classifier Function 497
10.4.7 train_classifier, Round 2 499
10.4.8 Testing the Classifier on New Data 502
10.4.9 The report_results Function 506
10.5 Running the Classifier on Full Data 508
10.5.1 Training versus Testing 508
10.6 Other Interesting Problems 512
10.6.1 Tag Clouds 512
10.6.2 S&P 500 Predictions 514
10.6.3 Predicting Religion with Flags 517
10.7 GUI to Plot the Stock Market 519
10.7.1 Function Model 519
10.7.2 Controller and View 521
xvi CONTENTS

P A R T 4 C L A S S E S , M A K I N G Y O U R O W N D AT A S T R U C T U R E S
AND ALGORITHMS 527
Chapter 11 Introduction to Classes 529
11.1 QuickStart: Simple Student Class 529
11.2 Object-Oriented Programming 530
11.2.1 Python Is Object-Oriented! 530
11.2.2 Characteristics of OOP 531
11.3 Working with OOP 531
11.3.1 Class and Instance 531
11.4 Working with Classes and Instances 532
11.4.1 Built-In Class and Instance 532
11.4.2 Our First Class 534
11.4.3 Changing Attributes 536
11.4.4 The Special Relationship Between an Instance and
Class: instance-of 537
11.5 Object Methods 540
11.5.1 Using Object Methods 540
11.5.2 Writing Methods 541
11.5.3 The Special Argument self 542
11.5.4 Methods Are the Interface to a Class Instance 544
11.6 Fitting into the Python Class Model 545
11.6.1 Making Programmer-Defined Classes 545
11.6.2 A Student Class 545
11.6.3 Python Standard Methods 546
11.6.4 Now There Are Three: Class Designer, Programmer,
and User 550
11.7 Example: Point Class 551
11.7.1 Construction 553
11.7.2 Distance 553
11.7.3 Summing Two Points 553
11.7.4 Improving the Point Class 554
11.8 Python and OOP 558
11.8.1 Encapsulation 558
11.8.2 Inheritance 559
11.8.3 Polymorphism 559
11.9 Python and Other OOP Languages 559
11.9.1 Public versus Private 559
11.9.2 Indicating Privacy Using Double Underscores (__) 560
CONTENTS xvii

11.9.3 Python’s Philosophy 561


11.9.4 Modifying an Instance 562
11.10 What’s Wrong with My Code? 562
Chapter 12 More on Classes 571
12.1 More About Class Properties 571
12.1.1 Rational Number (Fraction) Class Example 572
12.2 How Does Python Know? 574
12.2.1 Classes, Types, and Introspection 574
12.2.2 Remember Operator Overloading 577
12.3 Creating Your Own Operator Overloading 577
12.3.1 Mapping Operators to Special Methods 578
12.4 Building the Rational Number Class 581
12.4.1 Making the Class 581
12.4.2 Review Fraction Addition 583
12.4.3 Back to Adding Fractions 586
12.4.4 Equality and Reducing Rationals 590
12.4.5 Divide and Conquer at Work 593
12.5 What Doesn’t Work (Yet) 593
12.5.1 Introspection 594
12.5.2 Repairing int + Rational Errors 596
12.6 Inheritance 598
12.6.1 The “Find the Attribute” Game 599
12.6.2 Using Inheritance 602
12.6.3 Example: The Standard Model 603
12.7 What’s Wrong with My Code? 608
Chapter 13 Program Development with Classes 615
13.1 Predator–Prey Problem 615
13.1.1 The Rules 616
13.1.2 Simulation Using Object-Oriented Programming 617
13.2 Classes 617
13.2.1 Island Class 617
13.2.2 Predator and Prey, Kinds of Animals 619
13.2.3 Predator and Prey Classes 622
13.2.4 Object Diagram 623
13.2.5 Filling the Island 623
13.3 Adding Behavior 626
13.3.1 Refinement: Add Movement 626
13.3.2 Refinement: Time Simulation Loop 629
xviii CONTENTS

13.4 Refinement: Eating, Breeding, and Keeping Time 630


13.4.1 Improved Time Loop 631
13.4.2 Breeding 634
13.4.3 Eating 636
13.4.4 The Tick of the Clock 637
13.5 Refinement: How Many Times to Move? 638
13.6 Visual Vignette: Graphing Population Size 639

PART 5 BEING A BETTER PROGRAMMER 643


Chapter 14 Files and Exceptions II 645
14.1 More Details on Files 645
14.1.1 Other File Access Methods, Reading 647
14.1.2 Other File Access Methods, Writing 649
14.1.3 Universal New Line Format 651
14.1.4 Moving Around in a File 652
14.1.5 Closing a File 654
14.1.6 The with Statement 654
14.1.7 Text File Encodings; Unicode 655
14.2 CSV Files 656
14.2.1 CSV Module 657
14.2.2 CSV Reader 658
14.2.3 CSV Writer 659
14.2.4 Example: Update Some Grades 659
14.3 Module: os 661
14.3.1 Directory (Folder) Structure 662
14.3.2 os Module Functions 663
14.3.3 os Module Example 665
14.4 More on Exceptions 667
14.4.1 Basic Exception Handling 668
14.4.2 A Simple Example 669
14.4.3 Events 671
14.4.4 A Philosophy Concerning Exceptions 672
14.5 Exception: else and finally 673
14.5.1 finally and with 673
14.5.2 Example: Refactoring the Reprompting of a File Name 673
14.6 More on Exceptions 675
14.6.1 Raise 675
14.6.2 Create Your Own 676
14.7 Example: Password Manager 677
CONTENTS xix

Chapter 15 Recursion: Another Control Mechanism 687


15.1 What Is Recursion? 687
15.2 Mathematics and Rabbits 689
15.3 Let’s Write Our Own: Reversing a String 692
15.4 How Does Recursion Actually Work? 694
15.4.1 Stack Data Structure 695
15.4.2 Stacks and Function Calls 697
15.4.3 A Better Fibonacci 699
15.5 Recursion in Figures 700
15.5.1 Recursive Tree 700
15.5.2 Sierpinski Triangles 702
15.6 Recursion to Non-recursion 703
15.7 GUI for Turtle Drawing 704
15.7.1 Using Turtle Graphics to Draw 704
15.7.2 Function Model 705
15.7.3 Controller and View 706
Chapter 16 Other Fun Stuff with Python 709
16.1 Numbers 709
16.1.1 Fractions 710
16.1.2 Decimal 714
16.1.3 Complex Numbers 718
16.1.4 Statistics Module 720
16.1.5 Random Numbers 722
16.2 Even More on Functions 724
16.2.1 Having a Varying Number of Parameters 725
16.2.2 Iterators and Generators 728
16.2.3 Other Functional Programming Ideas 733
16.2.4 Some Functional Programming Tools 734
16.2.5 Decorators: Functions Calling Functions 736
16.3 Classes 741
16.3.1 Properties 742
16.3.2 Serializing an Instance: pickle 745
16.4 Other Things in Python 748
16.4.1 Data Types 748
16.4.2 Built-in Modules 748
16.4.3 Modules on the Internet 749
Chapter 17 The End, or Perhaps the Beginning 751
xx CONTENTS

APPENDICES 753
Appendix A Getting and Using Python 753
A.1 About Python 753
A.1.1 History 753
A.1.2 Python 3 753
A.1.3 Python Is Free and Portable 754
A.1.4 Installing Anaconda 756
A.1.5 Starting Our Python IDE: Spyder 756
A.1.6 Working with Python 757
A.1.7 Making a Program 760
A.2 The IPython Console 762
A.2.1 Anatomy of an iPython Session 763
A.2.2 Your Top Three iPython Tips 764
A.2.3 Completion and the Tab Key 764
A.2.4 The ? Character 766
A.2.5 More iPython Tips 766
A.3 Some Conventions for This Book 769
A.3.1 Interactive Code 770
A.3.2 Program: Written Code 770
A.3.3 Combined Program and Output 770
A.4 Summary 771
Appendix B Simple Drawing with Turtle Graphics 773
B.0.1 What Is a Turtle? 773
B.0.2 Motion 775
B.0.3 Drawing 775
B.0.4 Color 777
B.0.5 Drawing with Color 779
B.0.6 Other Commands 781
B.1 Tidbits 783
B.1.1 Reset/Close the Turtle Window 783
Appendix C What’s Wrong with My Code? 785
C.1 It’s Your Fault! 785
C.1.1 Kinds of Errors 785
C.1.2 “Bugs” and Debugging 787
C.2 Debugging 789
C.2.1 Testing for Correctness 789
C.2.2 Probes 789
C.2.3 Debugging with Spyder Example 1 789
C.2.4 Debugging Example 1 Using print() 793
CONTENTS xxi

C.2.5 Debugging with Spyder Example 2 794


C.2.6 More Debugging Tips 802
C.3 More about Testing 803
C.3.1 Testing Is Hard! 804
C.3.2 Importance of Testing 805
C.3.3 Other Kinds of Testing 805
C.4 What’s Wrong with My Code? 805
C.4.1 Chapter 1: Beginnings 805
C.4.2 Chapter 2: Control 807
C.4.3 Chapter 4: Strings 808
C.4.4 Chapter 5: Functions 809
C.4.5 Chapter 6: Files and Exceptions 810
C.4.6 Chapter 7: Lists and Tuples 811
C.4.7 Chapter 8: More Functions 812
C.4.8 Chapter 9: Dictionaries 813
C.4.9 Chapter 11: Classes I 814
C.4.10 Chapter 12: Classes II 815
Appendix D Pylab: A Plotting and Numeric Tool 817
D.1 Plotting 817
D.2 Working with pylab 818
D.2.1 Plot Command 818
D.2.2 Colors, Marks, and Lines 819
D.2.3 Generating X-Values 819
D.2.4 Plot Properties 820
D.2.5 Tick Labels 821
D.2.6 Legend 822
D.2.7 Bar Graphs 824
D.2.8 Histograms 824
D.2.9 Pie Charts 825
D.2.10 How Powerful Is pylab? 826
Appendix E Quick Introduction to Web-based User Interfaces 829
E.0.1 MVC Architecture 830
E.1 Flask 830
E.2 QuickStart Flask, Hello World 831
E.2.1 What Just Happened? 832
E.2.2 Multiple Routes 833
E.2.3 Stacked Routes, Passing Address Arguments 835
E.3 Serving Up Real HTML Pages 836
E.3.1 A Little Bit of HTML 836
E.3.2 HTML Tags 836
xxii CONTENTS

E.3.3 Flask Returning Web Pages 838


E.3.4 Getting Arguments into Our Web Pages 839
E.4 Active Web Pages 841
E.4.1 Forms in wtforms 841
E.4.2 A Good Example Goes a Long Way 842
E.4.3 Many Fields Example 847
E.5 Displaying and Updating Images 852
E.6 Odds and Ends 857
Appendix F Table of UTF-8 One Byte Encodings 859
Appendix G Precedence 861
Appendix H Naming Conventions 863
H.1 Python Style Elements 864
H.2 Naming Conventions 864
H.2.1 Our Added Naming Conventions 864
H.3 Other Python Conventions 865
Appendix I Check Yourself Solutions 867
I.1 Chapter 1 867
Variables and Assignment 867
Types and Operators 867
I.2 Chapter 2 868
Basic Control Check 868
Loop Control Check 868
More Control Check 868
for and range Check 868
I.3 Chapter 4 869
Slicing Check 869
String Comparison Check 869
I.4 Chapter 5 869
Simple Functions Check 869
I.5 Chapter 6 869
Exception Check 869
Function Practice with Strings 870
I.6 Chapter 7 870
Basic Lists Check 870
Lists and Strings Check 870
Mutable List Check 870
CONTENTS xxiii

I.7 Chapter 8 870


Passing Mutables Check 870
More on Functions Check 871
I.8 Chapter 9 871
Dictionary Check 871
Set Check 871
I.9 Chapter 11 871
Basic Classes Check 871
Defining Special Methods 871
I.10 Chapter 12 872
Check Defining Your Own Operators 872
I.11 Chapter 14 872
Basic File Operations 872
Basic Exception Control 872
INDEX 873
V I D E O N O T E S

VideoNote 0.1 Getting Python 13
VideoNote 1.1 Simple Arithmetic 64
VideoNote 1.2 Solving Your First Problem 73
VideoNote 2.1 Simple Control 96
VideoNote 2.2 Nested Control 140
VideoNote 3.1 Algorithm Decomposition 177
VideoNote 3.2 Algorithm Development 185
VideoNote 4.1 Playing with Strings 210
VideoNote 4.2 String Formatting 214
VideoNote 5.1 Simple Functions 251
VideoNote 5.2 Problem Design Using Functions 261
VideoNote 6.1 Reading Files 272
VideoNote 6.2 Simple Exception Handling 285
VideoNote 7.1 List Operations 327
VideoNote 7.2 List Application 349
VideoNote 8.1 More on Parameters 405
VideoNote 9.1 Using a Dictionary 437
VideoNote 9.2 More Dictionaries 465
VideoNote 10.1 Program Development: Tag Cloud 512
VideoNote 11.1 Designing a Class 545
VideoNote 11.2 Improving a Class 554
VideoNote 12.1 Augmenting a Class 593
VideoNote 12.2 Create a Class 596
VideoNote 13.1 Improve Simulation 623
VideoNote 14.1 Dictionary Exceptions 669
VideoNote 15.1 Recursion 692
VideoNote 16.1 Properties 742

xxiv
Exploring the Variety of Random
Documents with Different Content
England, however, the difficulties attendant on the use of coal appear to
have been overcome.
The reader will find in the third volume of Brongniart’s great work
(Traité des Arts Céramiques, Paris, 1877) several plates giving plans and
sections of all these types of furnaces. From a careful examination of these
engravings more is to be learned than from any amount of verbal
description. A thorough grasp of the process of firing is of the greatest
assistance in understanding the problems and difficulties that arise in the
manufacture of porcelain, and we shall have to return to the subject when
we come to treat of the several wares.
Whatever differences there may be in the shape of the furnaces, when it
comes to filling the interior with the ware to be baked, there is one
precaution which has been adopted in nearly every country.[14] The ware
must be protected from the direct heat of the flame by means of a case of
fireclay in which it is placed. These are the seggars (French cassettes; the
process of filling and arranging them is called encastage), to the preparation
of which so important a department has to be set apart in all porcelain
works, and whose manufacture adds so much to the working expenses.
The seggar proper is a cylindrical pan of fireclay, in shape and size like a
hatbox. They are piled, in the furnace, one over the other, and these piles or
‘bungs’ are arranged in the furnace so as to allow a free circulation of the
hot gases between them, but otherwise they are packed as closely together
as possible. These seggars may be used several times over. When broken,
the fragments are ground up and mixed with fresh fireclay or argile-
plastique to form new cases—without this addition the clay would be too
plastic or ‘fat’ for the purpose. The greatest precautions are taken in the
packing of the seggars in the furnace. The giving way of one pile from any
inaccuracy in the arrangement may destroy the contents of the whole oven.
So again infinite care must be taken in the arrangement and support of the
objects in each seggar. The bottom is covered with ground flint or other
infusible material, and the vessel is supported, when necessary, by various
forms of struts, props, or crow-claws, which sometimes leave their mark on
the base or side of the finished object. In spite of these precautions, a large
quantity of defective pieces or ‘wasters’ are produced in all works, and
these are usually cast aside. The finding of such fragments in after days is
sometimes the only proof we have that porcelain or pottery has formerly
been made at the spot. But the proof is final, for defective pieces and ‘crow-
claws’ are not objects likely to have been imported from a distance. Again,
the indelible marks left on the porcelain, either on the edge which rested
directly on the seggar or at the points where the object was supported by the
crow-claws, often give valuable hints as to the provenance of the piece in
question.[15] In the case of valuable wares these rough edges and marks are
removed as far as possible by grinding on a small wheel, and then polishing
the surface with pumice or with putty.
C H A P T E R III

GLAZES

B EFORE attacking the somewhat complicated subject of the nature and


composition of glazes, it will be well to take up again the thread of the
mechanical processes that are involved in the making of a piece of
porcelain.
The materials that enter into the glaze are reduced to the finest powder in
mills similar to those in which the china-stone and flint are ground for the
preparation of the paste. If any substance soluble in water, such as borax or
salts of the alkalis, enter into the composition of the glaze, these must be
first partially fused in combination with the other materials to form a frit, a
kind of imperfect glass. These frits, which enter so largely into the
composition of soft-paste porcelain, are formed with the object of bringing
the soluble constituents into an insoluble form before mixing with water to
form the slip. There are indeed other practical reasons that render a
preliminary partial fusion desirable.
The finely ground elements of the glaze, mixed in due proportion, are
worked up with water to form a creamlike slip into which the vessel to be
glazed is now dipped. In China, in many cases, the glaze-slip is blown upon
the surface in the form of a spray. This is done by means of a bamboo tube,
covered at one end by a piece of silk gauze, through which the liquid is
projected by the breath of the operator (French, insufflation); in other cases
the glaze may be painted on with a brush. In China, as we have mentioned,
the glaze-slip is generally applied to the raw surface of the thoroughly dried
but unbaked ware, but in other countries there is, almost without exception,
a preliminary firing of greater or less degree to produce a biscuit.
We shall restrict the use of the word glaze to the vitreous coating applied
directly to the surface of the raw paste or of the biscuit to enhance the
decorative effect of the ware, and with the more prosaic object of allowing
the surface to be easily kept clean. In the case of porcelain this coating is
always more or less transparent.[16] There is here no necessity for
concealing the natural white colour of the paste. In the case of many kinds
of pottery, however, as in the ‘enamelled fayence’ of Delft and Italy, the
glaze is rendered opaque by the addition of oxide of tin, so that the ill-
favoured ground is concealed by a white shiny surface which may be made
to resemble closely the natural surface of porcelain. A glaze of this kind is
often called an enamel, but as we are not concerned with such an expedient
we shall confine the use of that word to the various forms in which a
vitreous decoration, whether translucent or opaque, is superimposed upon
the glaze and fused into it, more or less thoroughly, by a subsequent firing
in a muffle furnace.
The English word ‘glaze’ is only another form of the word ‘glass,’ and
we may say at once that, in composition at least, there is often little
difference between the two substances. The French word for ‘glaze’ is
couverte or vernis; the last term applies well to the thin skin of glaze found
on Greek pottery. The Chinese have several expressions, but it is a curious
fact that the characters with which most of these terms are written contain
the radical for ‘oil,’ and indeed the word ‘oil’ itself is often used in the sense
of ‘glaze.’
Mr. Rix puts it well when he says that the glaze is to the enameller of
porcelain what his canvas is to the painter; while in the case of a decoration
‘sous couverte,’ the glaze corresponds to the varnish which, while
protecting his work, gives brilliancy to the colouring (Journal of Society of
Arts, vol. xli.). It is, moreover, the vehicle by which the design is
harmonised and rendered mellow. The effect is produced at once and
endures practically for all time.
The hardness and fusibility of glazes differ widely, and they are
conditioned by the nature of the wares that they cover. It is evident that
there must be a close relation between the fusing-points of paste and glaze,
and that the latter should be the more fusible of the two. The difference of
melting-point should, however, not be too great. The melted glaze should
rather, by penetrating into the already softened paste or by a chemical action
upon its surface, form a more or less uniform mass with it. In cooling, the
contraction of the glaze should follow that of the subjacent paste. This is a
most important point; any discordance may lead to splitting, cracking, and
‘crazing.’
The beauty of the surface of porcelain depends on the fact that the glaze
has become intimately united with the paste during the long exposure of
both to a high temperature. We should not be conscious, in regarding a fine
specimen of porcelain, of a greater or less thickness of glass covering an
opaque substance; we should rather see in it the polished surface of ivory or
of some precious marble.
It would seem that it was the beauty of the glassy surface, enhancing the
brilliancy of the colouring, rather than any practical advantage connected
with its use, that first led to the application of glaze to pottery. The
turquoise and green glazes of the Egyptians (the colour is derived from a
silicate of copper along with soda and sometimes lime) were known to the
men of the Early Empire. They were applied to a fritlike mass of sand held
together by silicate of soda, to which the name of porcelain has sometimes
been very wrongly given. Objects of steatite, of slate, and even of rock
crystal were sometimes covered with a coloured glaze of this kind, but it
was never applied to the clay vessels in daily use. These were made, then as
now, from the unctuous clay of the Nile bank. For this restriction there was
a very good reason, namely that a glaze of this nature, composed chiefly of
alkaline silicates, will not adhere to a base of ordinary clay. It was not until
Ptolemaic and Roman times that, by the discovery or adoption of a glaze
containing lead, the ancients were enabled to glaze their pottery. So in
Assyria, the employment of glazes was almost confined to the decoration of
the surface of brickwork, the bricks being of a loose and somewhat sandy
texture.[17]
In these glazes, and indeed in much earlier examples from Babylonia,
both tin and lead have been found. The respective virtues of the silicates of
these metals were doubtless appreciated, that of tin to form a white opaque
enamel hiding the material below, and that of lead to enable the glaze into
which it enters to adhere to a paste formed of a plastic clay.
With the Chinese the aim was rather æsthetic than practical. They sought
by means of the marvellous glazes that cover their ancient porcelain to
imitate the surface of natural stones; their early celadons were in a measure
intended to take the place of the precious green jade, so highly esteemed by
them.
At the time when the manufacture of porcelain was first introduced from
China there were (apart from the salt-glazed stoneware, which lies quite
outside our inquiry) three classes of glaze in general use either in Europe or
in the nearer East:—
1. Glazes consisting essentially of alkaline silicates without either lead or
tin. Such glazes could only be applied to a fritty silicious base, and in India
and Persia their employment seems to have been a survival from Egyptian
and Assyrian times.[18]
2. Opaque enamel glazes, the opacity being due to the presence of tin; a
considerable amount of lead also is generally found in these glazes. We are
not concerned here with the obscure origin of this group, but in the
sixteenth century this enamelled fayence was in general use for the better
class of table-ware. It includes the Italian majolica, the French fayence of
Nevers and Rouen, and above all the earthenware of Delft.
3. The oily-looking lead glazes with which the common earthenwares
were covered. These were essentially the glazes of the Middle Ages in
Europe, and their employment could probably be traced back to the lead-
glazed ware sparingly used by the Romans. We have already noticed the use
of a similar glaze in Egypt as far back probably as Ptolemaic times.
There were practical objections to all these glazes. It is true that at Delft,
by the use of the tin enamel, a ware could be turned out closely resembling,
in external aspect, the blue and white porcelain of China, but the enamel
was soft and would in time chip off at the edges, showing the dark earthy
clay beneath. On the other hand, the alkaline glazes of the East were not
much known in Europe; they can only be used upon a very tender and
treacherous base. In India and Persia, however, a ware thus glazed still
competes with the hard porcelain of the Far East. In spite of the great
objections to the glazes of our third class, those containing lead—objections
arising from their softness and from the danger of poisoning to those
employed in their manufacture—their use has tended rather to increase. Not
only is lead the principal constituent of the glazes still universally used for
common pottery, but it forms an important element in the glaze of our finer
earthenwares as well as in that of those bone pastes which rank with us as
porcelain.
The glaze which had been brought to perfection by the Chinese at an
early period differs from all those yet mentioned by its hardness, its high
fusing-point, and in its chemical composition. Speaking generally, the glaze
of porcelain differs in composition from the paste which it covers only
sufficiently to allow of its becoming completely liquid at the extreme heat
of the furnace; and just as the paste of Chinese porcelain has a wider limit
of variability than that made in Europe, but is on the whole of a ‘milder’
type than the latter, so we find that while the glazes of the Chinese are as a
whole less refractory and not quite so hard, there is still a wide range of
variation in these qualities.
If, then, we theoretically regard porcelain as a compound of a silicate of
alumina with an alkaline silicate of the same base, we may say that the
glaze of porcelain is formed by the latter body alone, that it is, in fact,
merely a fused felspar. But as in the case of the paste, so in the glaze there
is generally present an excess of silica, derived from the quartz contained in
the petuntse or pegmatite, and this silica enters into combination with some
other bases which are present in the constituents of the glaze, thereby
increasing its fusibility and modifying the contraction in cooling. The most
important of these additional bases is lime, so that the more fusible type
may be called a calcareous, as opposed to a more refractory or purely
felspathic glaze. As much as 21 per cent. of lime has been found in some
Chinese glazes, the amount of alumina being proportionately reduced.
There is more or less lime in the glaze of most kinds of European hard
porcelain, but the exceptionally hard and refractory paste made at Sèvres
since the time of Brongniart is covered by a glaze of corresponding
hardness from which that earth is absent. This hard paste has, however, of
late been replaced in part by one of a milder type, and with this latter a
calcareous glaze has been adopted even at Sèvres, the object of the change
being, as we have said, to allow of a more brilliant decoration.
There is a perceptible difference in the aspect of these two types of
glazes after firing. The hard, non-calcareous glaze has a slightly milky look.
The softer calcareous type is more brilliant, and approaches in transparence
and limpidity to the lead glazes of soft porcelain. A glaze of this last kind
was used at Sèvres for a few years after the first introduction of the hard
paste, and perhaps also at Dresden in quite early days.
The principal objection to a hard refractory glaze, such as that so long in
use at Sèvres, arises from the difficulty of properly incorporating the
enamel colours with its body. The restriction of the number of pigments that
can be employed, both under and on the surface of the glaze, in
consequence of the high temperature at which the latter melts, is another
drawback. The dulness, the ‘painted on’ look of so much of the decoration
on European hard paste porcelain, is in great measure a consequence of the
employment of a glaze that is only softened at a high temperature. As an
example of a medium type of glaze we give the composition of that used at
Berlin in 1836. This consisted of kaolin, 31 per cent.; quartz, 43 per cent.;
gypsum, 14 per cent.; and ground porcelain, 12 per cent. A glaze long in use
at Dresden is of a very similar character. Felspar, it will be seen, does not
enter into its composition, and such a glaze can contain but little potash or
soda. With this we may contrast the hard glaze of Sèvres, composed simply
of ground pegmatite, a rock consisting mainly of felspar. This glaze yields
on analysis 74 per cent. of silica, 17 per cent. of alumina, and as much as 8
per cent. of potash.
The glaze on Chinese porcelain is prepared by mixing certain special
varieties of petuntse with an impure lime, prepared by burning limestone
with dry fern as fuel. It contains, as we have seen, from 15 to 21 per cent. of
lime, 5 to 6 per cent. of alkalis, 11 per cent. of alumina, and 66 per cent. of
silica.
We give these examples to illustrate the principal types of glazes used
for hard paste porcelain. It will be noticed that the constituents are drawn
from widely different sources.
The glazes of soft paste porcelain always contain a large amount both of
lead and of potash or soda, so that they approximate in composition to a
flint glass. The alkalis, generally introduced as carbonates, necessitate a
previous fritting of part at least of the materials. Boracic acid plays an
important part in the glaze of most modern English wares: it is generally
introduced in the form of borate of soda or borax. This acid replaces in part
the silica, just as in the paste the glassy materials are replaced by bone-
earth.
C H A P T E R IV

DECORATION BY MEANS OF COLOUR

I F we were treating the subject purely from a practical point of view, with
the glazing and firing of a piece of porcelain the manufacture might be
held to be terminated. This would be strictly true, for instance, of the
white porcelain of Berlin, so largely used in the chemical laboratory; a great
deal, too, of the china in domestic use receives no decoration of any kind.
But for us there remains still to examine the element of colour and the way
in which it is applied to the decoration of porcelain.
This is effected in three different ways: by the employment of coloured
glazes; by painting on the surface of the paste before the glaze is applied
(this is the decoration sous couverte); and finally by coloured enamels
applied to the surface of the glaze. These methods may be combined, but as
this is rarely the case, such a division forms the basis of a convenient
classification, more especially for the wares of China and Japan.
In the case of both the paste and of the glaze, we have been dealing with
a restricted group of elements, with alumina, lime, potash and soda; and
apart from impurities unintentionally introduced, all the combinations of
these bodies are colourless. We have now to consider the effect of
introducing certain of the heavy metallic bases which combine with the
excess of silica to form coloured silicates.
The metals that give to Oriental porcelain its brilliant hues are few in
number. Indeed, in all lands and at all times, iron, copper, cobalt, and
manganese have been the principal sources of colour in the decoration not
only of porcelain, but of most other kinds of pottery. As equal to these four
metals in importance, but not strictly to be classed as colouring materials,
we may place tin, the source of most opaque whites, and lead, which is the
main fluxing element for our enamels. Next in importance to these metals
come antimony, long known to the Chinese as a source of yellow, and
finally, but this last only since the beginning of the eighteenth century, gold,
as the source of a red pigment.[19] This exhausts the list, not only for the
Far East, but for all the pottery of Europe up to the end of the eighteenth
century.
It was in a period of artistic decline that the advance of chemical
knowledge led to the introduction of other colours, derived both from new
metallic bases and from fresh combinations of those already known. By far
the most important of these new colours are those derived from the salts of
chromium, but uranium and other rare metals have also been called into
use. As with the sister art of painting, the beauty and harmony of the effects
produced have not kept pace with the enlargement of the palette—the result
was rather to accentuate the decline that had already set in from other
causes.
There are two metals, iron and copper, that have always been of pre-
eminent importance as sources of colour. Each of them forms two series of
combinations differing entirely in hue, so that were we confined to the use
of these two metals, our palette would still be a fairly complete one.
The protoxide of copper, especially when a certain amount of lime and
of soda is present, forms a series of beautiful blue and green silicates. When
the proportion of oxygen is decreased, as happens when the surface of the
ware is exposed in the kiln to a reducing flame, a suboxide of copper is
formed, which gives a deep and more or less opaque red hue to the glaze.
So in the case of iron, the so-called sesqui-oxide is perhaps the most
abundant source of colouring matter in the mineral kingdom: the colours
produced by it range from pale yellow to orange, brown, and full red.
When, however, the iron is present as a protoxide, the colour given to the
glaze is entirely altered; it ranges from a pale sea-green to a deep olive.
The remaining two elements that have long played an important part in
the decoration of pottery are cobalt and manganese. These metals, in the
form of silicates, yield the well-known series of blues and purples. One
important source of the famous underglaze blue of China and Japan is a
black mineral known to us as wad, which occurs in earthy to stony
concretions. This wad contains oxides of both cobalt and manganese, and
the quality of the blue obtained from it depends in great measure upon the
proportion in which the two metals occur.
The employment of antimony is comparatively rare, but, generally in
combination with iron, it is an important source of yellow. In spite of the
volatile nature of most of its salts, in the presence of silica this metal is able
to withstand a high temperature.
But before considering the application of colour to the glaze, we must
mention briefly a method of decoration which was in great favour at Sèvres
some years ago—I mean the application of colour to the paste itself. This
was done long ago by Wedgwood, sometimes to the whole mass of the
paste, as was the case with his jasper ware, which some authorities class as
a true porcelain. At Sèvres these coloured pastes have been generally
applied to the surface only, in thin layers, or even as mere coats of paint.
When laid on in successive coats, as in the so-called pâte-sur-pâte, the
amount of colouring matter need not be large, from 2 to 5 per cent. When
larger proportions of coloured oxides are mixed with the pâte, and this is
painted on with a brush, the process differs little from the ordinary
decoration under the glaze, into which it indeed may be said to pass.
Coloured pastes of this description have never been employed by the
Chinese, and it is not possible to obtain much brilliancy or decorative effect
by their use. They are, indeed, foreign to the nature of porcelain, sacrificing
the brilliant white ground which should be the basis of all decorative
schemes.
When the colouring matter is subjacent to the glaze it must be of a nature
to withstand the full heat of the subsequent firing; we are restricted
therefore to colours ‘à grand feu.’ This practically confines us to cobalt and
to certain combinations of iron and copper, as far as the ‘old palette’ is
concerned. At Sèvres and elsewhere other metals have been made use of
whose silicates withstand the extreme temperature of the kiln. By the use of
chromium we have command of many shades of green. If to an oxide of tin
we add a minute quantity of the sesqui-oxide of chromium, we can obtain,
in the presence of lime, many shades from rose to purple; and a mixture of
cobalt and chromium produces a fine black. There is, however, as yet no
satisfactory yellow pigment known that will withstand the grand feu. At the
best we can get a straw colour from certain ores of tungsten and titanium,
and from uranium a yellow deeper in tint but uncertain in application.
The majority of the colours we have mentioned require a more or less
oxidising flame for their full development. There are, however, two most
important groups of coloured glazes, long the monopoly of the Chinese, but
now successfully imitated in France and elsewhere, which require, for a
term at least, to be subjected to a reducing flame.
The first of these glazes is the well-known Celadon, using that term in
its proper and restricted sense, for certain shades of greyish green. The
celadon of the Chinese is produced by the presence of a small quantity,
about two per cent., of protoxide of iron in the glaze. An oxidising flame
would change this protoxide to the yellow sesqui-oxide. We may note that a
celadon of good tint can only be produced when a considerable quantity of
lime is present in the glaze.
The other group, depending also upon a reducing flame, is constituted by
the famous Sang de bœuf and Flambé glazes.
The colour of the first is given by the red sub-oxide of copper, chiefly
suspended in the glaze. In the case of the flambé or ‘transmutation’ glazes,
the strange caprices of colour have their origin, in part at least, in the
contrast of the red sub-oxide and the green silicate of copper. In the case of
both these glazes everything depends on the regulation of the draught of the
furnace in which they are fired. The French have lately been at great pains
to master the difficulties attendant upon the development of the effects
sought after, and some success has been attained not only on a porcelain
ground as at Sèvres, but these glazes have also been applied to fayence at
the Golfe St. Juan and elsewhere. It has been proved by some experiments
made at Sèvres, that in the firing, the critical period, during which so much
depends upon the regulation of the draught, is just before the melting of the
glaze. Once melted the glaze not only forms an impervious cover which
prevents the smoky flame from discolouring the paste below, but the glaze
itself is no longer sensitive to the action of the gases which surround it. It is
therefore only during a short period preceding the moment when the glaze
begins to melt, that it is necessary to promote a smoky and reducing flame.
This is a point of considerable practical importance.[20]
The application of the Decoration under the Glaze is essentially a
Chinese method. To it we owe the important family of ‘blue and white’
ware. The superiority of the Chinese in the management of the blue colour
has been attributed to various causes. The result is no doubt influenced not
only by the constitution of both paste and glaze, but also by the fact that the
colour is painted upon the raw paste.
An important factor also is the care exercised by the Chinese in the
selection and preparation of the blue pigment, by which not only the desired
intensity but the richness of hue is secured. The quality of the blue depends
in great measure upon the presence of a small quantity of manganese in the
cobalt ore employed.
The only other colour that the Chinese have succeeded in using under
the glaze is the red derived from the sub-oxide of copper. The full
development of this colour has for long been a lost art, but a less brilliant
red from this source, often little better than a buff colour, is sometimes
found in later examples combined with the blue.
In the application of colours under the glaze there is one difficulty that
the Chinese have surmounted even in their commonest ware, and this is the
tendency of the cobalt blue to dissolve and ‘run’ in the glaze, giving to the
design a blurred and indistinct appearance. It would seem that the sharpness
of outline depends upon the consistency of the glaze at the moment when it
first melts. At that point the glaze should be viscous and not inclined to
flow, and this is what occurs in the case of the highly calcareous glazes of
the Chinese.
Before passing to the enamel colours, we must say something of a class
of glazes which may be looked upon as to some extent of an intermediate
character. These are the glazes associated with the ‘San tsai,’ the ‘three
colours’ first used in combination by the Chinese.
These coloured glazes were applied, not, as is usually the case in China,
to the raw paste, but they were, it would seem, painted on the surface after a
preliminary firing. Being applied with a brush, the whole surface of the
biscuit was not necessarily covered, and glazes of all these colours could be
used upon the same piece of porcelain. Glazes of this class were rendered
more fusible by the addition of a certain quantity of lead, and on this
ground, and still more in their historical relation, as we shall see later on,
these ‘painted glazes’ may be considered as a link connecting the old
refractory glazes of the monochrome and ‘blue and white’ wares on the one
hand, with the fusible enamels which were at a later time superimposed
upon the glaze on the other.
The three colours which are applied in this way by the Chinese are: (1) A
turquoise blue derived from copper with the addition of some soda or
potash. (2) The manganese purple, often described as aubergine. (3) A
yellow prepared from an iron ore containing some amount of antimony.
None of these colours would stand the full heat of the furnace, and for a
reason which will be explained further on, they are known as the colours of
the demi grand feu.[21]
Coloured Enamels. We have now to describe
PLATE II. CHINESE MING PORCELAIN, BLACK GROUND

the decoration that is applied to the surface of the glaze. In these coloured
enamels the colouring matter is dissolved in a flux which contains a large
quantity of lead. The comparatively gentle heat at which such enamels fuse
allows of the use of a much larger palette than is available for the
decoration under the glaze.
It is well to point out at the outset the marked distinction in composition
and in appearance between the brilliant enamels of the Chinese and the dull
tints of the ‘porcelain colours’ found in the hard pastes of Meissen and
Sèvres. To make clear the cause of this difference it will be necessary to
enter into some little detail.
The colouring matter in the European enamels may amount to as much
as a third part of the total amount of the flux with which they are
incorporated. As there is not enough of this flux to dissolve the whole of the
oxides, the enamel remains dull and opaque after firing. The flux, in fact, is
only used as a vehicle to attach the colour to the surface of the porcelain.
The effect in consequence is inferior in brilliancy to that obtained by the
Chinese with their transparent enamels in which the metallic oxides, present
in much smaller quantity, are thoroughly dissolved to form a glass. There is,
unfortunately, a practical obstacle to the application of these glassy enamels
to the hard pastes and glazes of Europe. It is impossible to ensure their firm
adhesion to the subjacent glaze. The Chinese, however, do not appear to
find any difficulty in effecting this. The following explanation has been
given to account for the difference of behaviour:—the tendency of the
enamel to split off in cooling, as has been proved by experiment, arises
from the small amount of contraction at that time of the highly kaolinic
paste, compared with that of the superimposed glassy enamel. The more
silicious paste used by the Chinese contracts, on the contrary, at the same
rate approximately as the enamels that it carries, and these enamels may
therefore be laid on in sufficient thickness without any risk of their
subsequently splitting off.[22] To appreciate the difference in the decorative
value of these two classes of enamels it is only necessary to compare the
brilliant effect, say, of a piece of Chinese egg-shell of the time of Kien-lung
with the tame surface of a contemporary Meissen plate, elaborately painted
with landscapes or flowers.
The glassy enamels used by the Chinese resemble the pastes used for
artificial jewellery. They are essentially silicates of lead and an alkali. The
composition of the flux has to be modified to ensure the full development of
the colour of the different metallic oxides which are either made up with it
or added subsequently. But in a general way we may say that the colourless
fluxes which form the basis of the coloured enamels are prepared by
melting in a crucible a mixture of pure quartz sand and red lead, and adding
more or less alkali. In certain cases the lead predominates, as when it is
proposed to make an emerald green enamel by means of copper, or when
the flux is to serve as a basis for the ruby colour given by a minute quantity
of gold. On the other hand, if copper be added to a flux containing an
excess of either soda or potash, we obtain a turquoise blue. A fine purple,
again, can only be obtained from manganese with an alkaline flux; if too
much lead is present only a brown tint is obtainable.
To melt these enamels and to ensure their adherence to the subjacent
glaze another firing at a gentler temperature is necessary; indeed in many
cases more than one such firing has to be resorted to. The comparatively
high temperature required to develop the colour of one enamel may be
sufficient to decompose or otherwise damage another part of the decoration.
The lowest temperature of all is that of the muffle-fire in which the gilding
is fixed. This is therefore the last decoration to be added.
The oven in which these enamels are melted on to the surface of the
already glazed porcelain is called a muffle. The ware in this case is
protected from the direct action of the flame by the closed rectangular box
of fireclay in which it is placed, like bread in a baker’s oven. The muffle is
placed over the fireplace of a rectangular furnace, and the flame plays round
the sides in such a way as to ensure the uniform distribution of the heat. For
the sake of greater cleanliness and the avoidance of dust, the pieces to be
fired are placed upon tiles of porcelain rather than upon biscuit or fireclay
supports. The temperature may vary from a dull to a full red heat (600° to
1000°C.), and the firing lasts from four to twelve hours.
We have already mentioned incidentally many of the so-called ‘muffle-
colours’ or enamels. Those used in China were carefully studied some years
ago by Ebelmen and Salvétat at Sèvres. It would appear that the opaque
white of the Chinese is obtained from arsenic—the merits of the use of tin
for this purpose appear to be unknown to them. The blacks are made from
the already mentioned cobalt-manganese ore (wad), mixed with white lead
—when oxide of copper is added a more lustrous black is obtained.[23] For
the blue enamel, a very small quantity of cobalt suffices to give a brilliant
colour. The various tints of the greens and blues derived from copper
depend on the nature of the flux; of this we have already given an instance.
Antimony in combination with lead gives a bright yellow, which tends to
orange when a little iron is present; by the addition of more iron the colour
of old bronze is imitated. Iron in the state of the sesqui-oxide is the source
of many shades of red, but as this iron oxide will not readily combine with
silica to form a transparent glass, it has to be applied as a more or less
opaque paint, and thus differs from the other colours in being in perceptible
relief. Hence the importance of the ruby red derived from gold, which was
first introduced into China in the early part of the eighteenth century, and
soon became the predominating colour in the decoration of the time (the
famille rose).
The palette of the European enameller is a more extensive one, and each
large porcelain manufactory has its book of recipes. The composition of the
enamels and the relation of the metallic oxides to the fluxes employed have
been systematically studied in more than one laboratory. It is only at Sèvres,
however, that the results obtained have been made public. It has been the
pride of successive generations of chemists—of Brongniart, of Salvétat, of
Ebelmen, not to mention living men—to devise fresh sources of colour for
the decoration of porcelain. First chromium, then nickel, cadmium,
uranium, iridium, and platinum have been added to the list of metals from
which enamel pigments have been derived. Among the colours of the
muffle-stove the chief gain has perhaps been the discovery of the quality
possessed by the oxide of zinc of altering the tints of other metallic oxides
with which it is mixed.
CHAPTER V

THE PORCELAIN OF CHINA

Introductory—Classification—The Sung Dynasty (960-1279)—The Mongol or Yuan Dynasty


(1280-1368).

‘La porcelaine de la Chine! Cette


porcelaine supérieure à toutes les
porcelaines de la terre! Cette porcelaine
qui a fait depuis des siècles, et sur tout le
globe, des passionnés plus fous que dans
toutes les autres branches de la
curiosité.... Enfin cette matière terreuse
façonnée dans les mains d’hommes en un
objet de lumière, de doux coloris dans un
luisant de pierre précieuse.’—Edmond
de Goncourt, ‘La Maison d’un artiste.’

In any work on porcelain it is something more than the premier place


that must be given to the ware of China. We are dealing with an art Chinese
in origin, and during a succession of many centuries Chinese in its
development. It was only at a comparatively late time that the knowledge of
this art spread over the whole civilised world. We in England have, as it
were, acknowledged the pre-eminence of that country by adopting the word
‘china’ as an equivalent, more or less, to porcelain.[24]
It was under Imperial patronage that the art was developed in China, and
the excellence of the porcelain of that country has in a measure varied with
the taste and intelligence with which that patronage was exercised in
different reigns. The native scholar and connoisseur has for ages been a
collector of choice pieces, and his influence has always been exercised in a
conservative direction. There is, indeed, in the whole world no such
consistent laudator temporis acti, and it is this conservative spirit, resulting
in a constant ‘returning upon oneself,’ that it is essential to bear in mind if
we are to understand the involved relation of the old and the new in the
history of the arts of China.
But the Chinese potter was not working only for the court or for the
learned connoisseur, or again for the supply of the towns and villages. From
the earliest times, or at least for the last thousand years, there has been a
demand for his ware, small at first but slowly spreading, from the outer
barbarian. Porcelain, or something akin to it, has been exported from China,
by one path or another, from the time of the first Arab settlements at Canton
and Kinsay in the eighth or ninth century; and thus a countervailing
influence, acting in the direction of variety and change, at least as far as the
decoration of the ware is concerned, has always been present. To give but
two instances of this influence—we shall return to the subject later on: in
the intimate connection of the Chinese court with Western Asia, and
especially with Persia, in the thirteenth century, we may probably find the
occasion of the first introduction into China of the blue decoration under the
glaze; and with more certainty—the fact is indeed acknowledged by the
Chinese—we may attribute the second great revolution in the decoration of
porcelain, the use of enamel colours over the glaze, to European or Arab
influence.
On the other hand, the decline that set in at the end of the eighteenth
century was not a little hastened by the increased demand for ware
decorated to suit the depraved taste of the ‘Western barbarian.’
For in spite of his rigidity and his conservative spirit, the Chinese potter
has always understood how to adapt his wares to the changing taste of his
customers. Indeed the variation in the decoration, the subtle nuances in
colour and design, that enable us to distinguish between the Chinese
porcelain exported to India, to Persia, and to the nations of the Christian
west, might be made the basis of a most interesting study.
When we come to consider the various factories of porcelain that sprang
up in Europe in the course of the eighteenth century, we shall find that what
strikes the inquirer above all (in comparison with the kindred arts of the
time) is the little we can observe in the way of development either in the
technique or decoration of the wares. The art springs up full-blown; what
history there is is concerned rather with an artistic decline. It is only in
China that we can hope to trace the steps by which this special branch of the
potter’s art attained to the perfection that we find in the products of the
eighteenth century, and this alone is a reason for dwelling, even in a
treatment of the subject so general and brief as this must needs be, on what
may seem to some mere antiquarian detail.
But there is another and perhaps even a more important reason for our
trying to form some idea of what the earliest wares of the Chinese were
like: unless we make some such endeavour we shall find it impossible to
understand the later history of porcelain in that country. One point must be
specially borne in mind when we are attempting to follow the order in
which fresh styles and designs were introduced in China. When a new
method of decoration had been adopted and had come into general use—the
introduction of underglaze blue in early Ming times, and that of coloured
enamels at a later period, are cases in point—this did not involve the
abandonment of the older styles. There was a constant effort to maintain the
old methods, and in the most flourishing times of the emperors Kang-he and
Kien-lung, the series of great men who had charge of the imperial works at
King-te-chen, some of them practical potters themselves, were constantly
occupied with the problems of reproducing the glazes, if not the pastes, of
the earliest wares. During the reign of Yung-chêng (1723-1735), perhaps the
culminating period in the history of Chinese porcelain, when Nien Hsi-yao
was superintendent, a list was drawn up of fifty-seven varieties of porcelain
made at King-te-chen. In this list the titles of all the old wares of the Sung
dynasty are to be found, and to them the place of honour is evidently
awarded (Bushell, chap. xii.). The names of some of these old wares, the Ko
yao and the Kuan yao, for instance, are applied to porcelain in common use
at the present day, an attribution based on the greater or less resemblance of
this modern ware to the Sung porcelain, at least in the matter of the glazes.
It is only quite of late years that we in Europe have been able to make
any clear distinction, not only between the different classes of Chinese
porcelain, but between what is Chinese and what is not. A few years ago the
most characteristic porcelain of Japan was classed as Chinese, while on the
other hand Corea and even local English factories were credited with
porcelain made and decorated in one or other of the former countries.
It is nearly two hundred years since the famous letters of the Jesuit
missionary, the Père D’Entrecolles, were written, and these letters still
remain our best source of information for the processes of manufacture at
King-te-chen. There was little further information on the subject from the
Chinese side[25] until, in 1856, Stanislas Julien translated part of a Chinese
work treating chiefly of the same porcelain factory—this is the King-te-
chen Tao Lu, a book which contains in addition some information about the
history of the different wares. This translation was for many years the only
native source of information available to students of Chinese porcelain, and
many were the misconceptions and blunders in which these students were
landed. The book was indeed accompanied by a preface and valuable notes
by M. Salvétat, the porcelain expert of Sèvres, but Julien himself, though an
eminent Chinese scholar, had no practical acquaintance either with the
matter in hand or indeed with the country generally.
The beginning of a sounder knowledge of the subject was made when
that collector of genius, the late Sir A. Wollaston Franks, published a
catalogue of the private collection of Japanese and Chinese porcelain which
he afterwards presented to the nation. His marvellous intuition and his vast
experience enabled him to seize upon points of resemblance and difference
which threw light upon the origin of the various wares, and to expose at the
same time the inconsistencies of the arrangements then in vogue. He it was
who first pointed out the general worthlessness, as a guide to the date or
even the country of any piece of porcelain, of the name of dynasty and
emperor which it might bear. His successor, Mr. C. H. Read, has well
carried on the tradition. At the present moment the British Museum is one
of the few places where an attempt has been made at a systematic
arrangement of a representative collection of Chinese and Japanese
porcelain.[26]
In the meantime in China itself, both in connection with the embassies at
Pekin and among some of the merchants at Shanghai and other treaty ports,
much information was being collected, and it was above all the merit of
Franks to keep himself in communication with and to encourage all such
research. Dr. Hirth, long in the service of the Chinese at Shanghai and
elsewhere, has published a series of learned studies treating of the relation
of the Chinese to the Roman empire, of the Arab traders during the Middle
Ages, and of the early history of Chinese porcelain generally. But it is to a
former member of our embassy at Pekin, to Dr. Bushell, that we are above
all indebted for the throwing open of Chinese sources of information upon
the history of porcelain. A worthy successor of the Père D’Entrecolles in his
intimate acquaintance with the country and its language, Dr. Bushell is well
abreast of the chemical and technical knowledge of the day, and his position
as physician to our embassy at Pekin has given him access to information
from the best Chinese sources, as well as to the treasures of many of the
native collections of the capital.
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about testbank 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!

ebooksecure.com

You might also like