100% нашли этот документ полезным (1 голос)
39 просмотров

PDF C and Python Applications: Embedding Python Code in C Programs, SQL Methods, and Python Sockets First Edition Philip Joyce download

Книга 'C and Python Applications' авторства Филипа Джойса охватывает внедрение кода Python в программы на C, методы SQL и сокеты Python. Она содержит подробные главы о программировании на Python и C, а также о работе с SQL, включая создание баз данных и манипуляцию данными. Документ также включает упражнения и примеры кода для практического применения изучаемого материала.

Загружено:

piatzlenox50
Авторское право
© © All Rights Reserved
Доступные форматы
Скачать в формате PDF, TXT или читать онлайн в Scribd
100% нашли этот документ полезным (1 голос)
39 просмотров

PDF C and Python Applications: Embedding Python Code in C Programs, SQL Methods, and Python Sockets First Edition Philip Joyce download

Книга 'C and Python Applications' авторства Филипа Джойса охватывает внедрение кода Python в программы на C, методы SQL и сокеты Python. Она содержит подробные главы о программировании на Python и C, а также о работе с SQL, включая создание баз данных и манипуляцию данными. Документ также включает упражнения и примеры кода для практического применения изучаемого материала.

Загружено:

piatzlenox50
Авторское право
© © All Rights Reserved
Доступные форматы
Скачать в формате PDF, TXT или читать онлайн в Scribd
Вы находитесь на странице: 1/ 37

Get the full ebook with Bonus Features for a Better Reading Experience on ebookmeta.

com

C and Python Applications: Embedding Python Code


in C Programs, SQL Methods, and Python Sockets
First Edition Philip Joyce

https://ebookmeta.com/product/c-and-python-applications-
embedding-python-code-in-c-programs-sql-methods-and-python-
sockets-first-edition-philip-joyce/

OR CLICK HERE

DOWLOAD NOW

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


C and
Python
Applications
Embedding Python Code in C Programs,
SQL Methods, and Python Sockets

Philip Joyce
C and Python
Applications
Embedding Python Code in
C Programs, SQL Methods,
and Python Sockets

Philip Joyce
C and Python Applications: Embedding Python Code in C Programs, SQL Methods,
and Python Sockets

Philip Joyce
Crewe, UK

ISBN-13 (pbk): 978-1-4842-7773-7 ISBN-13 (electronic): 978-1-4842-7774-4


https://doi.org/10.1007/978-1-4842-7774-4

Copyright © 2022 by Philip Joyce


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Celestin Suresh John
Development Editor: James Markham
Coordinating Editor: Divya Modi
Cover designed by eStudioCalamar
Cover image designed by Pixabay
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza,
New York, NY 10004. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or
visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is
Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware
corporation.
For information on translations, please e-mail [email protected]; for reprint, paperback,
or audio rights, please e-mail [email protected].
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub via the book’s product page, located at www.apress.com/9781484277737. For more
detailed information, please visit http://www.apress.com/source-­code.
Printed on acid-free paper
Table of Contents
About the Author����������������������������������������������������������������������������������������������������� ix

About the Technical Reviewer��������������������������������������������������������������������������������� xi


Acknowledgments������������������������������������������������������������������������������������������������� xiii

Introduction�������������������������������������������������������������������������������������������������������������xv

Chapter 1: Python Programming������������������������������������������������������������������������������ 1


Definition of Variables������������������������������������������������������������������������������������������������������������������� 1
Real (Float) Numbers��������������������������������������������������������������������������������������������������������������� 5
Characters������������������������������������������������������������������������������������������������������������������������������� 6
Reading in Data����������������������������������������������������������������������������������������������������������������������������� 6
Arrays�������������������������������������������������������������������������������������������������������������������������������������������� 8
Inserting into an Array������������������������������������������������������������������������������������������������������������� 9
Deleting (Removing) from an Array��������������������������������������������������������������������������������������� 10
Searching������������������������������������������������������������������������������������������������������������������������������ 10
Updating an Array������������������������������������������������������������������������������������������������������������������ 11
Appending to an Array����������������������������������������������������������������������������������������������������������� 11
Strings����������������������������������������������������������������������������������������������������������������������������������������� 12
Lists�������������������������������������������������������������������������������������������������������������������������������������������� 14
Reading Entries in a List�������������������������������������������������������������������������������������������������������� 15
Updating a List����������������������������������������������������������������������������������������������������������������������� 16
Deleting an Element from List����������������������������������������������������������������������������������������������� 16
Appending to a List���������������������������������������������������������������������������������������������������������������� 16
Dictionaries��������������������������������������������������������������������������������������������������������������������������������� 17
Creating a Dictionary������������������������������������������������������������������������������������������������������������� 17
Appending to a Dictionary����������������������������������������������������������������������������������������������������� 17
Amending a Dictionary���������������������������������������������������������������������������������������������������������� 18

iii
Table of Contents

Deleting from a Dictionary����������������������������������������������������������������������������������������������������� 19


Searching Through a Dictionary�������������������������������������������������������������������������������������������� 19
Tuples������������������������������������������������������������������������������������������������������������������������������������������ 20
Creating a Tuple��������������������������������������������������������������������������������������������������������������������� 21
Concatenating Two Tuples����������������������������������������������������������������������������������������������������� 22
Creating Nested Tuples���������������������������������������������������������������������������������������������������������� 22
Creating Repeated Tuples������������������������������������������������������������������������������������������������������ 22
Converting a List or a String into a Tuple������������������������������������������������������������������������������� 23
Creating Single-Element Tuple���������������������������������������������������������������������������������������������� 23
Reading Tuple������������������������������������������������������������������������������������������������������������������������ 23
Searching Within a Tuple������������������������������������������������������������������������������������������������������� 23
Deleting a Tuple��������������������������������������������������������������������������������������������������������������������� 24
Using Tuple to Create Variables��������������������������������������������������������������������������������������������� 24
If Then Else��������������������������������������������������������������������������������������������������������������������������������� 25
Loops (For and While)����������������������������������������������������������������������������������������������������������������� 26
For Loops������������������������������������������������������������������������������������������������������������������������������� 26
While Loops��������������������������������������������������������������������������������������������������������������������������� 28
Switches������������������������������������������������������������������������������������������������������������������������������������� 29
Arithmetic Operations Using Numpy������������������������������������������������������������������������������������������� 30
Numpy Calculations��������������������������������������������������������������������������������������������������������������� 34
Mathematical Graph Functions��������������������������������������������������������������������������������������������������� 38
User-Written Functions��������������������������������������������������������������������������������������������������������������� 43
File Access���������������������������������������������������������������������������������������������������������������������������������� 45
Regressions�������������������������������������������������������������������������������������������������������������������������������� 52
Summary������������������������������������������������������������������������������������������������������������������������������������ 57
Exercises������������������������������������������������������������������������������������������������������������������������������������� 57

Chapter 2: C Programming������������������������������������������������������������������������������������� 59
C Program Format����������������������������������������������������������������������������������������������������������������������� 59
Adding Two Numbers������������������������������������������������������������������������������������������������������������������ 60
Multiply and Divide Two Numbers����������������������������������������������������������������������������������������������� 62
For Loops������������������������������������������������������������������������������������������������������������������������������������ 63
iv
Table of Contents

Do While Loops��������������������������������������������������������������������������������������������������������������������������� 65
Switch Instruction����������������������������������������������������������������������������������������������������������������������� 66
If Else������������������������������������������������������������������������������������������������������������������������������������������ 67
If Else If��������������������������������������������������������������������������������������������������������������������������������������� 68
Data Arrays��������������������������������������������������������������������������������������������������������������������������������� 70
Functions������������������������������������������������������������������������������������������������������������������������������������ 81
Strings����������������������������������������������������������������������������������������������������������������������������������������� 86
Structures����������������������������������������������������������������������������������������������������������������������������������� 88
Size of Variables�������������������������������������������������������������������������������������������������������������������������� 91
Goto Command��������������������������������������������������������������������������������������������������������������������������� 92
Common Mathematical and Logical Symbols����������������������������������������������������������������������������� 93
File Access���������������������������������������������������������������������������������������������������������������������������������� 94
Student Records File������������������������������������������������������������������������������������������������������������� 95
Summary���������������������������������������������������������������������������������������������������������������������������������� 105
Exercises����������������������������������������������������������������������������������������������������������������������������������� 106

Chapter 3: SQL in C����������������������������������������������������������������������������������������������� 107


Review of SQL and SQLite��������������������������������������������������������������������������������������������������������� 107
Creating the Database�������������������������������������������������������������������������������������������������������������� 108
Creating a Table������������������������������������������������������������������������������������������������������������������������ 110
Inserting Rows�������������������������������������������������������������������������������������������������������������������������� 113
Insert a Preset Row������������������������������������������������������������������������������������������������������������� 113
Inserting a User-Entered Row���������������������������������������������������������������������������������������������� 114
Selecting Rows������������������������������������������������������������������������������������������������������������������������� 117
Selecting a Row Preset������������������������������������������������������������������������������������������������������� 117
Selecting All Rows��������������������������������������������������������������������������������������������������������������� 120
Selecting Rows by Age�������������������������������������������������������������������������������������������������������� 122
Amending Rows������������������������������������������������������������������������������������������������������������������������ 125
Deleting Rows��������������������������������������������������������������������������������������������������������������������������� 128
Summary���������������������������������������������������������������������������������������������������������������������������������� 130
Exercises����������������������������������������������������������������������������������������������������������������������������������� 130

v
Table of Contents

Chapter 4: SQL in Python�������������������������������������������������������������������������������������� 131


Review of SQL��������������������������������������������������������������������������������������������������������������������������� 131
Create a Table���������������������������������������������������������������������������������������������������������������������� 133
Mechanism for Inserting a Row������������������������������������������������������������������������������������������� 134
Update a Row���������������������������������������������������������������������������������������������������������������������� 139
Delete a Row����������������������������������������������������������������������������������������������������������������������� 148
Read a Table������������������������������������������������������������������������������������������������������������������������ 149
Summary���������������������������������������������������������������������������������������������������������������������������������� 150
Exercises����������������������������������������������������������������������������������������������������������������������������������� 150

Chapter 5: Embedded Python������������������������������������������������������������������������������� 151


Basic Mechanism���������������������������������������������������������������������������������������������������������������������� 151
Plot a 2D Line���������������������������������������������������������������������������������������������������������������������������� 153
Plot Two 2D Lines���������������������������������������������������������������������������������������������������������������������� 155
Plot Trigonometric Curves��������������������������������������������������������������������������������������������������������� 158
Enter Data to Plot���������������������������������������������������������������������������������������������������������������������� 160
2D Center of Mass Plot������������������������������������������������������������������������������������������������������������� 170
Histograms�������������������������������������������������������������������������������������������������������������������������������� 177
Importing a Picture������������������������������������������������������������������������������������������������������������������� 179
Summary���������������������������������������������������������������������������������������������������������������������������������� 181
Exercise������������������������������������������������������������������������������������������������������������������������������������ 181

Chapter 6: Sockets����������������������������������������������������������������������������������������������� 183


A Closer Look at Sockets���������������������������������������������������������������������������������������������������������� 183
Basic Client-Server������������������������������������������������������������������������������������������������������������������� 185
Server-Client Pair to Send-Receive a File��������������������������������������������������������������������������������� 187
Threaded Programs������������������������������������������������������������������������������������������������������������������ 191
Closing Down a Threaded Server���������������������������������������������������������������������������������������������� 194
Chat Programs�������������������������������������������������������������������������������������������������������������������������� 197
Summary���������������������������������������������������������������������������������������������������������������������������������� 199
Exercise������������������������������������������������������������������������������������������������������������������������������������ 199

vi
Table of Contents

Appendix A: Answers to Examples����������������������������������������������������������������������� 201


C
 hapter 1���������������������������������������������������������������������������������������������������������������������������������� 201
Chapter 2���������������������������������������������������������������������������������������������������������������������������������� 206
Chapter 3���������������������������������������������������������������������������������������������������������������������������������� 212
Chapter 4���������������������������������������������������������������������������������������������������������������������������������� 219
Chapter 5���������������������������������������������������������������������������������������������������������������������������������� 223
Chapter 6���������������������������������������������������������������������������������������������������������������������������������� 228

Index��������������������������������������������������������������������������������������������������������������������� 231

vii
About the Author
Philip Joyce has 28 years of experience as a software engineer, working on control of
steel production, control of oil refineries, communications software (pre-Internet), office
products (server software), and computer control of airports. He programs in Assembler,
COBOL, Coral 66, C, and C++ with SQL. He served as a mentor to new graduates in the
Ferranti Company. He obtained an MSc in computational physics (including augmented
matrix techniques and Monte Carlo techniques using Fortran) from Salford University in
1996. He is also a chartered physicist and a member of the Institute of Physics (member
of the Higher Education Group).

ix
About the Technical Reviewer
Swathi Sutrave is a self-professed tech geek. She has been
a subject matter expert for several different programming
languages, including Python, C, and SQL, for corporations,
startups, and universities.

xi
Acknowledgments
Thanks to my wife, Anne, for her support, my son Michael, and my daughter Katharine.
All three have mathematics degrees. Thanks to everyone on the Apress team who helped
me with the publication of this, my third book.

xiii
Introduction
The C and Python programming languages are important languages in many computer
applications. This book will demonstrate how to use the C and Python languages to write
applications in SQL. It will demonstrate how to embed a Python program within a C
program. Finally, the reader will learn how to create Python socket programs which can
communicate with each other on different computers (these are called “sockets”).
A basic familiarity with mathematics is assumed along with some experience of the
basics of computer programs. The first two chapters review the basics of C and Python.
The chapters following these are grouped into SQL techniques, embedded Python, and
sockets applications. There are exercises in each chapter with answers and suggested
code at the end of the book.

xv
CHAPTER 1

Python Programming
This is the first of two chapters in which you’ll review both Python and C programming
languages. A basic understanding of computing and what programs are about is
assumed although no prior knowledge of either Python or C is needed.
In this chapter, we will start with the basics of Python. This will include how items
used in a program are stored in the computer, basic arithmetic formats, handling strings
of characters, reading in data that the user can enter on the command line, etc. Then
we will work up to file access on the computer, which will lead us up to industrial/
commercial-level computing by the end of the book.
If you don’t already have a Python development environment on your computer,
you can download it and the Development Kit, free of charge, from www.python.org/
downloads/. Another way you can access Python is by using Visual Studio. Again, a
version of this can be downloaded.

D
 efinition of Variables
This section looks at the different types of store areas that are used in Python. We refer
to these store areas as “variables.” The different types can be numbers (integers or
decimals), characters, and different types of groups of these (strings, arrays, dictionaries,
lists, or tuples).
In these examples, you can go to the command line and enter “Python” which starts
up the Python environment and produces “>>>” as the prompt for you to enter Python
code.

1
© Philip Joyce 2022
P. Joyce, C and Python Applications, https://doi.org/10.1007/978-1-4842-7774-4_1
Chapter 1 Python Programming

In Python, unlike C, you don’t define the variable as a specific type. The different
types are integer, floating point, character, string, etc. The type is assigned when you give
the variable a value. So try the following code:

>>> a1 = 51
>>> print(type(a1))
We get the output
<class 'int'>
>>>

Here we are defining a variable called “a1” and we are assigning the integer value 51
to it.
We then call the function “print” with the parameter “type” and “a1” and we get the
reply “class ‘int’”. “type” means that we want to display whether the variable is an integer,
floating point, character, string, etc.
We can now exit the Python environment by typing “quit()”.
We will now perform the same function from a program.
Create a file called “typ1a.py”.
Then enter the following two lines of Python code:

a1=51
print(type(a1))

Now on the command line, enter “python typ1a.py”.


And you should get the output

<class 'int'>

which is the same as our first example.


This is just demonstrating the equivalence of the two methods.
Obviously, if you want to run a program with many lines of code and possibly run it
many times, then having the code in a file is more efficient.
We can demonstrate different data types being stored in the same variable using the
following code:

a1=51
print(type(a1))

a1=51.6
print(type(a1))
2
Chapter 1 Python Programming

a1='51'
print(type(a1))

When we run this, we get

<class 'int'>
<class 'float'>
<class 'str'>

The 51 entered is an int. The 51.6 is a float (decimal) type, and ‘51’ is a string.
We can make the results a little clearer if we use print(“a1 is”, type(a1)).
So our program now reads

a1=51
print("a1 is",type(a1))

a1=51.6
print("a1 is",type(a1))

a1='51'
print("a1 is",type(a1))

and the output is

a1 is <class 'int'>
a1 is <class 'float'>
a1 is <class 'str'>

We can put a comment on our line of code by preceding it with the “#” character.

a1='51' #assign string containing 51 to variable a1


print("a1 is",type(a1)) # print the type assigned to a1

Some simple arithmetic operations are shown in the following.


The following code is held in the file “arith1.py”:

arith1a.py

Initialize the variables v1, v2, v3, and v4 with integer values.

v1= 2
v2 = 4
v3 = 7
v4 = 8
3
Another Random Scribd Document
with Unrelated Content
Barley-sugar, 564
Barley-water, excellent (poor Xury’s receipt), 583
Basket, wire, for frying, 177
Batter, French, for frying meat and vegetables, &c., 130
cod’s sounds fried in, 63
salsify, fried in, 341
spring fruit, fried in, 383
to mix for puddings, 397
Béchamel, 108
Beans, French, to boil, 321
à la Française, 321
another excellent receipt for, 322
Windsor, to boil, 322
Beef, à la mode, 192
breslaw of, 206
cake (very good), 190
to choose, 184
minced collops of, au naturel, 201
savoury minced collops of, 201
Scotch minced collops of, 202
richer minced collops of, 202
divisions of, 184
Dutch or hung, 197
extract of, Baron Liebig’s, 6
fillet of, braised, 180
fillet of, roast, 187
hashed, French receipt for, 206
cold, common hash of, 205
cold, excellent hash of, 205
collared, 198
collared, another receipt for, 198
gravy, Baron Liebig’s, 96
Norman hash of, 206
heart, to roast, 204
Jewish (smoked), 606
kidney, to dress, 204
kidney (a plainer way), 205
marrow, clarified for keeping, 208
marrow, to prepare for frying croustades, &c., 388
marrow-bones, to boil, 207
marrow-bones, baked, 208
minced, baked, 207
palates (Entrée), 194
palates (Neapolitan mode), 195
Hamburg pickle for, 197
another pickle for, 197
ribs of, to roast, 185
roll, or canellon de bœuf, 201
miniature round of, 200
round of, to salt and boil, 196
round of, spiced, 199
round of, roast, 186
rump of, to roast, 186
rump of, to stew, 194
to salt and pickle, various ways, 196
common receipt for salting, 198
saunders of, 207
shin of, to stew, 192
shin of, for stock, 97
sirloin of, to roast, 185
sirloin of, stewed, 193
spiced (good and wholesome), 199
smoked, 606
steak, roast, 187
steak, stewed, 189
steak, stewed in its own gravy, 189
steaks, best and most tender, 185
steaks, broiled, 187
steaks, broiled, sauces appropriate to, 188
steaks, fried, 189
steaks, à la Française, 188
steaks, à la Française, another receipt for, 189
steak pie, 354
steak puddings, 399, 401
good English stew of, 191
German stew, 190
Stufato, 615
Welsh stew of, 191
tongue (Bordyke’s receipt for stewing), 203
tongue potted, 305
tongues (various modes of curing), 202
tongues, to dress, 203
tongues, Suffolk receipt for, 203
Beet-root, to bake, 339
to boil, 339
to stew, 340
Belgrave mould, 469
Bengal currie powders, 615
Bermuda witches, 491
Birthday syllabub, 581
Biscuits, Aunt Charlotte’s, 561
Captain’s, good, 560
Colonel’s, 561
cheap ginger, 560
Threadneedle-street, 560
wine, 560
Bishop, Oxford receipt for, 580
Black-cap pudding, 407
Black-caps par excellence, 460
Black cock, and gray hen, to roast, 291
Blamange, or blanc manger, apricot, 479
good common (author’s receipt), 476
calf’s feet, to make, 454
currant, 479
quince (delicious), 478
quince, with almond cream, 478
rich, 477
strawberry (extremely good), 477
strengthening, 476
Blanc, a, 169
Blanch, to, meat, vegetables, &c., 182
Blanquette, of sucking pig, 250
of veal or lamb with mushrooms, 229
Boil, to, meat, 167
a round of beef, 196
Boiled, calf’s head, 210
chestnuts, 274
custards, 481
eels (German receipt), 83
fowls, 273
leeks, 318
rice, to serve with stewed fruit, &c., 422
rice-pudding, 419, 420
turnip radishes, 318
breast of veal, 218
fillet of veal, 217
knuckle of veal, 221
loin of veal, 218
Boiling, general directions for, 167
scientific, Baron Liebig’s directions for, 168
Bonbons, palace, 567
Bone, to, calf’s head for brawn, 24, 215
calf’s head, the cook’s receipt, 211
calf’s head for mock turtle soup, 24
a fowl or turkey without opening it, 265
a fowl or turkey, another mode, 265
fowls, for fricassees, curries, and pies, 266
a hare, 285
a leg of mutton, 236
a loin of mutton for pies, 355
a breast of veal, 618
a shoulder of veal or mutton, 219
neck of venison for pies, 352
Boning, general directions for, 182
Bottle Jack, 170
Bottled fruits, for winter use,
gooseberries,
tomatas, or tomata-catsup, 151
Boudin, à la Richelieu, 288
Boudinettes of lobsters, &c., 92
Boulettes, potato, 314
Bouilli, French receipt for hashed, 206
Bouillon, observations on, 9
Brain cakes, 162
another receipt for, 162
Braise, to burn, 180
Braised fillet of beef, 180
leg of mutton, 236
Braising, directions for, 180
Brandy, cherry (Tappington Everard receipt), 579
lemon, for flavouring sweet dishes, 153
peaches preserved in, 571
trifle, or tipsy cake, 274
Brandied morella cherries, 571
Brawn Brack, cake (Irish), 546
good, light, 554
Brawn, calf’s head (author’s receipt), 215
Tenbridge, 260
Bread, Bordyke receipt for, 597
to know when baked, 604
Bavarian brown, Liebig’s, 599
brown, English, 599
crumbs, fried, 131
crumbs, to prepare for frying fish, 131
dairy, without yeast, 602
to freshen stale, 603
to fry for garnishing, 131
to fry for soups, 5
with German yeast, 598
home-made, remarks on, 594
household, 596
to keep, 603
partridges served with, 279
patties, 387
potato, 600
puddings, 418, 430
and butter puddings, 428, 429
rules to be observed in making, 596
sauce, 112
sauce with onion, 113
unfermented, 599
to purify yeast for, 595
Bream, sea, to dress, 75
Brioche paste, 349
Brill, to boil, 58
Broccoli, 326
Broiled beef steak, 187
bacon, 259
cutlets, mutton, 241
cutlets, pork, 251
eels with sage (German), 617
fowl, 274
mackerel, 71
red mullet, 76
partridge, 290
partridge (French receipt), 290
Broiling, general directions for, 175
Broil, the Cavalier’s, 240
Broth, or bouillon, 6
veal, or mutton, 44
Browned flour for thickening soups and sauces, 131
Browning, with salamander, 183
Brown, rich, English gravy, 99
apple sauce, 125
caper sauce, 121
chestnut sauce, 129
mushroom sauce, 123
onion sauce, 125
rabbit soup, 31
Brown to, with salamander, 183
Brussels sprouts, 340
Buns, light, of different kinds, 559
Exeter, 559
excellent soda, 561
Geneva, 601
Burdwan, an Indian, 612
Burlington Whimsey, 212
Burnt coffee, or gloria, 592
Buttered apples, 488
cherries, 490
Butter, anchovy, 138
burnt, or browned, 109
clarified, for storing and for immediate use, 110
to cool for crust, 345
creamed, and otherwise prepared for cakes, 543
lobster, 138
melted, good common, 108
melted, French, 109
melted, rich, 108
melted, rich, without flour, 109
melted, white, 109
loin of lamb stewed in, 246
truffled, 139
Buttermilk, for bread, 602
Cabbage, to boil, 332
stewed, 333
red, to stew (Flemish receipt), 340
red, to pickle, 539
Café noir, 592
Cake, fine almond, 545
apple, 362
beef or mutton, 190
breakfast, French, 549
a cheap common, 555
cream cake, 554
thick, light gingerbread, 551
a good light luncheon cake, 554
cheap nursery, 555
a good Madeira, 548
pound, 546
rice, 546
sausage-meat, or pain de porc frais, 261
a good soda, 556
a good sponge, 547
a smaller sponge, 547
tipsy, 474
veal, 222
veal, good (Bordyke receipt for), 222
Venetian or Neapolitan (super-excellent), 547
white, 546
Cakes, Banbury, 549
to colour sugar candy for, 542
flead, or fleed, 558
cocoa-nut gingerbread, 552
common gingerbread, 553
richer gingerbread, 553
queen, 556
general remarks on, 540
very good small rich, 558
to prepare butter for rich, 543
to whisk eggs for light rich, 543
small, sugar, various, 558
small Venetian, 548
Calf’s head, à la Maître d’Hôtel, 214
boiled, 210
brawn (author’s receipt), 215
to clear the hair from, 210
cutlets of, 213
hashed, 213
a cheap hash of, 213
prepared, the cook’s receipt, 211
soup, 27
The Warder’s way, 211
Calf’s feet jelly (entremets), 461
another receipt for, 462
jelly, apple, 464
jelly, orange, 464
modern varieties of, 463
to prepare for stock, 453
stewed, 228
stock, 453
stock, to clarify, 454
Calf’s liver, stoved or stewed, 228
roast, 229
sweetbreads, 227
Cambridge milk punch, 581
Candy, cocoa-nut, 566
ginger, 565
orange-flower, 565
orange-flower (another receipt for), 566
Canellon de bœuf, 201
Canellons, filled with apricot or peach marmalade, 385
of brioche paste, 385
Caper sauce, 121
sauce for fish, 121
Capillaire in punch, 580
Caramel, to boil sugar to, 563
the quickest way, 563
Carp, to stew, 82
Carrots, au beurre, 336
to boil, 335
in their own juice 337
mashed, or buttered (Dutch), 336
in plum pudding, 417
sweet, for second course, 336
the Windsor receipt (Entrée), 335
Carrot, soup, common, 20
soup, a finer, 20
Casserole of rice, savoury, 351
of rice, sweet, 438
Catsup, the cook’s, or compound, 149
lemon, 150
mushroom, 146,148
mushroom, double, 148
pontac, for fish, 150
tomato, 151
walnut, 149, 150
Cauliflowers, to boil, 325
French receipt for, 325
à la Française, 326
with Parmesan cheese, 325
Cavalier’s, the, broil, 240
Cayenne, vinegar, 153
Celery, boiled, 341
salad, to serve with pheasants, 341
sauce, 128
stewed, 341
Chantilly baskets, 474
Charlotte de pommes, or apple Charlotte, 486
à la Parisienne, 487
Chatnies (Mauritian), 144, 610
Cheese, damson, 520
in fondu, 379
Italian pork, 260
with maccaroni, 392
with maccaroni, à la Reine, 393
in ramakins, 375
to serve with white and maccaroni soup, 13
cheese-cakes, cocoa-nut (Jamaica receipt), 371
Madame Werner’s Rosenvik, 372
Cherries, brandied, morella, 571
Cherries, compote of Kentish, 458
compote of morella, 458
morella, to dry, 504
dried with sugar, 502
dried without, 503
dried, superior receipt, 503
to pickle, 532
brandy, 579
cherry, cheese, 504
cherry, paste, 504
Chestnuts, boiled, 574
roasted, 574
stewed, 342
Chestnut forcemeat, No. 15, 162
sauce, brown, 129
sauce, white, 129
soups, 19
Chetney, various ways of making, 144
Chicken, broiled, 274
cutlets, 275, 276
fried, à la Malabar, 276
patties (good), 359
potato pasty, 350
Chicken pie (common), 353
modern pie, 353
Chickens, boiled, 273
fricasseed, 275
in soup, 29
China chilo of mutton, 241
Chocolate, almonds, 568
drops, 567
to make, 592
Spanish receipt for making, 592
Chops, lamb or mutton, broiled, 241
mutton, stewed in their own gravy (good), 240
pork, 251
Chorissa, or Jewish sausage, with rice, 607
Christopher North’s own sauce for many meats, 119
Cocoa, to make, 593
Cocoa-nut candy, 566
cheese-cakes, 371
in curries, 296
Doce, 490
gingerbread, 553
macaroons, 545
puddings, 424
soup, 19
Cod fish, to boil, 61
slices of, fried, 61
stewed, 62
stewed in brown sauce, 62
Cod’s sounds, to boil, 63
to fry in batter, 63
Coffee, to boil, 591
breakfast, French, 590
burnt, or coffee à la Militaire, vulgarly called Glosia, 592
to filter, 590
directions for making, 589
strong, clear, to serve after dinner, called café noir, 592
remarks on, 587
to roast, 588
roaster, 588
Cold, calf’s head, to re-dress, 214
Cold, fowls, ditto, 276, 277
leg of mutton, ditto, 207
Maître d’Hôtel, sauce, 133
meat, excellent sauces to serve with, 133, 134, 136
salmon, to dress, 59
turbot, ditto, 59
Collops minced, au naturel, 201
savoury minced, 201
sauté-pan for frying, 176
Scotch, 226
Scotch minced, 202
Compote of apples, baked (our little Lady’s receipt), 572
of green apricots, 457
of bullaces, 458
of cherries, 458
of Kentish cherries, 458
of Morella cherries, 458
of green currants, 457
of red currants, 457
of damsons, 458
of figs, 492
of green gooseberries, 457
of magnum bonum, or other large plums, 458
of peaches, 459
of peaches, another receipt, 459
Compote de pigeons, 619
Compote de pigeons aux petits pois, 619
of Siberian crabs, 458
of spring fruit (rhubarb), 457
Confectionary, 562
Conjurer, a, its uses, 175
Consommé, 10
Constantia jelly, 467
Cookery (English), common causes of its failure, 167
Cool cup, a, 582
Corn, Indian green, to boil, 329
Counsellor’s cup, 585
Crab, cold, dressed, 88
hot, 89
Creamed tartlets, 375
spring fruit, or rhubarb trifle, 486
Cream, Chantilly basket filled with, 474
Cream cake, delicious, 554
crust, 347
Devonshire, or clotted, 451
jelly, filled with, 469
lemon, made without cream, 475
Nesselróde, 471
remarks on, 450
Swiss, 473
in soups, 19, 22, 29, 30
Creams, lemon (very good), 475
fruit, 475
Italian, 475
Crême à la Comtesse, or the Countess’s cream, 272
Crême, Parisienne, 479
patissiere, 373
Crisped potatoes, or potato-ribbons, to serve with cheese, 313
Croquettes of rice (entremets), 385
of rice, filled with preserve,
of rice, savoury, 386
Croustades, or Dresden patties, 387
of various kinds, 387
small, dressed in marrow, 388
small, à la bonne maman, 389
to prepare marrow for frying, 388
Croûte aux-champignons, or mushroom-toast, 330
Crust butter, for puddings, 398
cream, 347
flead, 347
French, for hot or cold meat pies, 347
excellent short, 349
rich short, for tarts, 349
Crust, common suet for pies, 348
very superior suet, for pies, 348
suet, for puddings, 398
Crusts, to serve with cheese, 398
Cucumber (author’s receipt), to dress, 323
soup, 38
vinegar, 152
Cucumbers à la Crème, 324
à la Poulette, 324
dressed, 323
fried, 324
stewed, 323
Curds and whey, 451
Currants, to clean for puddings and cakes, 397
green, stewed, 457
red, stewed, 457
Currant, blamange, 479
custard, 482
dumplings, 421
jam, red (delicious), 509
jam, white, 510
jelly, fine black, 511
jelly, French, 509
jelly, superlative red, 509
jelly, white, very fine, 510
jelly, tartlets, 375
paste, 510
pudding, 408
syrup, or sirop de groseilles, 579
Curried eggs 301
gravy, 302
maccaroni, 300
oysters, 302
toasts, with anchovies, 389
sweetbreads, 301
Currie, Mr. Arnott’s, 297
a Bengal, 298
a dry, 298
common Indian, 299
Currie powder, Mr. Arnott’s, 297
Curries, remarks on, 296
Selim’s (Capt. White’s), 300
Custard, baked, common, 483
a finer 483
currant, 482
the Duke’s, 482
the Queen’s, 481
veal, or a Sefton, 362
Custards, boiled, good, old-fashioned, 481
boiled, rich, 481
chocolate, 483
French, 484
quince, or apple, 482
Cutlets of calf’s head, 213
Chicken, English, 275
of fowls, partridges, or pigeons (Entrée), 276
lamb, in their own gravy, stewed, 246
lamb, or mutton, with Soubise sauce, 246
mutton, broiled, 241
of cold mutton, 243
mutton, in their own gravy, stewed, 240
pork, 251
veal à la Française, 226
veal à l’Indienne, or Indian fashion, 225
veal à la mode de Londres, or London fashion, 226
veal, plain, 225
of sweetbreads, 227
Damson, cheese, 520
jam, 519
jelly, 519
solid, 519
pudding, 408
Des Cerneaux, or walnut salad, 141
Devonshire junket, 452
Dough nuts, Isle of Wight, receipt for, 556
Dresden patties, or croustades, 387
Dried apples, to stew, 572
apricots, French receipt, 517
cherries, with sugar, 502, 503
cherries, without sugar, 503
gooseberries, with and without sugar, 501
mushrooms, 153
plums (Pruneaux de Tours), to stew, 573
Dry, to apricots, a quick and easy method, 517
Imperatrice plums, 521
Mogul plums, 515
peaches or nectarines, 518
Duck, stewed, 279
Ducks, to roast, 279
stuffing for, No. 9, 160
wild, to roast, 294
Dumplings, apple (fashionable) 420
currant, light, 421
lemon, 421
Norfolk, 421
Suffolk, or hard, 421
Dutch, or hung beef, 197
custard, 438
flummery, 477
Eels, boiled, German receipt, 83
Cornish receipt, 84
to fry, 83
Egg balls, 162
sauce, for calf’s head, 111
sauce, common, 110
sauce, good, 110
a swan’s, to boil hard, 448
swan’s, en salade, 448
Eggs, to boil in the shell, 445
to cook in the shell, without boiling, 445
continental mode of dressing, or œufs au plat, 450
Eggs, to dress Guinea fowls or Bantams, 416
to dress turkeys, 417
curried, 301
forced turkey’s or swan’s, 447
forced, for salad, 137
to preserve for many weeks, 444
poached, with gravy, 449
to poach, 449
to whisk, for cakes, 543
Elderberry wine, 584
Elegant, the Economist’s, pudding, 415, 428
lobster salad, 142
English, brioche, 349
brown gravy, 99
game pie, 352
puff paste, 346
stew, 191
Entrées, beef cake, 190
beef collops, 201
beef palates, 194, 195
beef roll, or canellon de bœuf, 201
beef steaks à la Française, 188, 189
beef tongues, 202
Bengal currie, 298
blanquette of sucking pig, 250
blanquette of veal or lamb, with mushrooms, 229
broiled mutton cutlets, 241
broiled ox-tail, 195
boudinettes of lobsters, shrimps, &c., 92
calf’s head à la Maître d’Hôtel, 214
calf’s head, the Warder’s way, 211
calf’s liver, stewed, 228
casserole of rice, 351
chicken cutlets, 275
chicken patties, 359
compote de pigeons, 299
curries, 297, 298, 299, 300, 301, 302, 615
croquettes of savoury, of rice, 386
croustades filled with mince, 387
cutlets of calf’s head, 213
cutlets of fowls, partridges, or pigeons, 275
Dresden patties, 387
fillets of mackerel, 71
fillets of mackerel in wine, 72
fillets of soles, 65
fillets of whitings, 68[194]
fowls, à la Carlsfors, 273
fricandeau of veal, 223
fricasseed fowls or chickens, 274
fried chicken à la Malabar, 275
hashed fowl, 276
lamb cutlets in their own gravy, 246
lamb or mutton cutlets, with soubise sauce, 246
lobster cutlets, 91
lobsters fricasseed, 89
loin of lamb stewed in butter, 216
minced fowl, 276
minced veal with oysters, 231
mutton cutlets in their own gravy, 210

Вам также может понравиться