Rapid GUI Programming with Python and Qt 1st Edition Mark Summerfield pdf download
Rapid GUI Programming with Python and Qt 1st Edition Mark Summerfield pdf download
https://ebookname.com/product/rapid-gui-programming-with-python-
and-qt-1st-edition-mark-summerfield/
https://ebookname.com/product/gui-programming-with-python-qt-
edition-boudewijn-rempt/
https://ebookname.com/product/programming-in-python-3-a-complete-
introduction-to-the-python-language-2nd-edition-summerfield/
https://ebookname.com/product/programming-python-4th-edition-
mark-lutz/
https://ebookname.com/product/the-making-of-a-human-bomb-an-
ethnography-of-palestinian-resistance-nasser-abufarha/
Medicine Creek Seventy Years of Archaeological
Investigations 1st Edition Donna C. Roper
https://ebookname.com/product/medicine-creek-seventy-years-of-
archaeological-investigations-1st-edition-donna-c-roper/
https://ebookname.com/product/swaziland-bradt-travel-guides-1st-
edition-mike-unwin/
https://ebookname.com/product/voices-from-the-vietnam-war-
xiaobing-li/
https://ebookname.com/product/marx-in-movement-operaismo-in-
context-1st-edition-antonio-negri/
https://ebookname.com/product/trade-unions-and-migrant-workers-
new-contexts-and-challenges-in-europe-1st-edition-stefania-
marino/
Rapid GUI Programming
with Python and Qt
The Definitive Guide to PyQt Programming
Mark Summerfield
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
vii
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
viii
Creating and Using Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Restoring and Saving the Main Window’s State . . . . . . . . . . . . . . 181
Handling User Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Handling File Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Handling Edit Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Handling Help Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
ix
Multiple Document Interface (MDI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Chapter 10. Events, the Clipboard, and Drag and Drop . . . . . . . . . 303
The Event-Handling Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Reimplementing Event Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Using the Clipboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Drag and Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Handling Custom Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
x
Chapter 14. Model/View Programming . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Using the Convenience Item Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Creating Custom Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Implementing the View Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
Implementing the Custom Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
Creating Custom Delegates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
xi
Chapter 19. Multithreading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Creating a Threaded Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
Creating and Managing Secondary Threads . . . . . . . . . . . . . . . . . . . . . 544
Implementing a Secondary Thread . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
This Is Not Quite the End . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
xii
Foreword
As PyQt’s creator, I’m delighted to see that this book has been written. Al-
though I served as one of the book’s technical reviewers, I’m happy to confess
that I learned a few things myself.
The PyQt documentation covers the APIs of all the PyQt classes. This book
shows you how to use all those classes, how to combine them to create dialogs,
main windows, and entire applications—all of which look good and work well,
with no arbitrary limits, and using a programming language that is a joy
to use.
What I particularly like about the book is that the examples aren’t trivial ones
designed to illustrate a simple point, but are potentially useful in their own
right. The way that different approaches are considered will reward the reader
who wants to develop a deeper understanding of how to apply PyQt to the
development of large scale, production quality applications.
I began the PyQt story back in the late 1990s. I had been using Tcl/Tk for
some time, but I felt that Tk applications looked ugly, especially when I saw
what had been achieved with the first version of KDE. I had wanted to switch
to Python, and so I thought I would combine the change of language with a
change of GUI library.
Initially I used some wrappers that had been written using SWIG, but I con-
cluded that I could produce a more suitable wrapper tool myself. I set to work
creating SIP, and released PyQt 0.1 supporting Qt 1.41 in November 1998.
Development has continued regularly ever since, both to keep up with new re-
leases of Qt and to broaden the scope of PyQt with, for example, the addition
of support tools and improved documentation. By 2000, PyQt 2.0 supported
Qt 2.2 on both Linux and Windows. Qt 3 support appeared in 2001, and
Mac OS X support in 2002. The PyQt4 series began with PyQt 4.0 in June 2006
with support for Qt 4.
My primary goal has always been to allow Python and Qt to work together in
a way that feels natural to Python programmers, while allowing them to do
anything they want in Python that can be done in C++. The key to achieving
this was the development of SIP. This gave me a specialized code generator
over which I had complete control and ensures that Python and Qt will always
fit snugly together.
The essential process of developing and maintaining PyQt is now well estab-
lished. Much of the work is now automated, which means that keeping up with
xiii
new releases of Qt from Trolltech is no longer the problem it once was, and en-
surs that PyQt will continue for years to come.
It’s been very gratifying to watch the growth of the PyQt community over the
years. If this book is part of your introduction to PyQt, then welcome!
— Phil Thompson
Wimborne, Dorset, U.K.
August 25, 2007
xiv
Introduction
This book teaches how to write GUI applications using the Python program-
ming language and the Qt application development framework. The only
essential prior knowledge is that you can program in some object-oriented pro-
gramming language, such as C++, C#, Java, or of course, Python itself. For the
rich text chapter, some familiarity with HTML and with regular expressions is
assumed, and the databases and threading chapters assume some basic knowl-
edge of those topics. A knowledge of GUI programming is not required, since
all the key concepts are covered.
The book will be useful to people who program professionally as part of their
job, whether as full-time software developers, or those from other disciplines,
including scientists and engineers, who need to do some programming in sup-
port of their work. It is also suitable for undergraduate and post-graduate stu-
dents, particularly those doing courses or research that includes a substantial
computing element. The exercises (with solutions) are provided especially to
help students.
Python is probably the easiest to learn and nicest scripting language in
widespread use, and Qt is probably the best library for developing GUI applica-
tions. The combination of Python and Qt, “PyQt”, makes it possible to develop
applications on any supported platform and run them unchanged on all the
supported platforms—for example, all modern versions of Windows, Linux,
Mac OS X, and most Unix-based systems. No compilation is required thanks
to Python being interpreted, and no source code changes to adapt to different
operating systems are required thanks to Qt abstracting away the platform-
specific details. We only have to copy the source file or files to a target machine
that has both Python and PyQt installed and the application will run.
If you are new to Python: Welcome! You are about to discover a language that
is clear to read and write, and that is concise without being cryptic. Python
supports many programming paradigms, but because our focus is on GUI
programming, we will take an object-oriented approach everywhere except in
the very early chapters.
Python is a very expressive language, which means that we can usually write
far fewer lines of Python code than would be required for an equivalent appli-
cation written in, say, C++ or Java. This makes it possible to show some small
but complete examples throughout the text, and makes PyQt an ideal tool for
rapidly and easily developing GUI applications, whether for prototyping or for
production use.
1
2 Introduction
programming teams varying in size from just one person to more than a dozen
people. Many in-house tools are written using PyQt, but because these are of-
ten used to gain competitive advantage, the companies involved generally do
not permit their use of PyQt to be made public. PyQt is also widely used in the
open source world, with games, utilities, visualization tools, and IDEs all writ-
ten using it.
This book is specifically about PyQt4, the Python bindings for the Qt 4 C++
application development framework.★ PyQt4 is provided in the form of ten
Python modules which between them contain around 400 classes and about
6 000 methods and functions. All the example programs have been tested on
Windows, Linux, and Mac OS X, using Python 2.5, Qt 4.2, and PyQt 4.2, and
additionally on Windows and Linux using Qt 4.3 and PyQt 4.3. Backporting to
earlier versions is possible in some cases, but we recommend using the most
up-to-date versions of Python, Qt, and PyQt.
Python, PyQt, and Qt can be used free of charge for noncommercial purposes,
but the license used by Python is different from that used by PyQt and Qt.
Python is available with a very liberal license that allows it to be used to de-
velop both commercial and noncommercial applications. Both PyQt and Qt are
dual-licensed: This essentially allows them to be used to develop noncommer-
cial applications—which must in turn be licensed using an acceptable open
source license such as the GNU General Public License (GPL); or to be used to
develop commercial applications—in this case, a commercial PyQt license and
a commercial Qt license must be purchased.
The book is divided into four parts. Part I is primarily a rapid conversion course
aimed at non-Python programmers who are familiar with an object-oriented
language, although it also has some (clearly marked) PyQt content. Because
the core Python language is mostly simple and is quite small, these chapters
can teach the basics of Python to a sufficient extent that real Python applica-
tions can be written.
If you think that you can pick up the Python syntax simply through reading
it, you might be tempted to skip Part I and dive straight into the GUI pro-
gramming that begins in Part II. The early chapters in Part II include back-
references to the relevant pages in Part I to support readers who choose this
approach. However, even for readers familiar with Python, we recommend
reading about QString in Chapter 1. If you are unfamiliar with partial function
application (currying), it is important to read the subsection that covers this in
Chapter 2, since this technique is sometimes used in GUI programming.
★
There are also Python bindings for the older Qt 3 library, but there is no reason to use that library
for new projects, especially since Qt 4 offers far more functionality and is easier to use.
4 Introduction
Part II begins by showing three tiny PyQt GUI applications to give an initial
impression of what PyQt programming is like. It also explains some of the
fundamental concepts involved in GUI programming, including PyQt’s high-
level signals and slots communication mechanism. Chapter 5 shows how to
create dialogs and how to create and lay out widgets (“controls” in Windows-
speak—the graphical elements that make up a user interface such as buttons,
listboxes, and such) in a dialog. Dialogs are central to GUI programming: Most
GUI applications have a single main window, and dozens or scores of dialogs,
so this topic is covered in depth.
After the dialogs chapter comes Chapter 6, which covers main windows,
including menus, toolbars, dock windows, and keyboard shortcuts, as well as
loading and saving application settings. Part II’s final chapters show how to
create dialogs using Qt Designer, Qt’s visual design tool, and how to save data
in binary, text, and XML formats.
Part III gives deeper coverage of some of the topics covered in Part II, and in-
troduces many new topics. Chapter 9 shows how to lay out widgets in quite
sophisticated ways, and how to handle multiple documents. Chapter 10 covers
low-level event handlers, and how to use the clipboard as well as drag and drop,
text, HTML, and binary data. Chapter 11 shows how to modify and subclass
existing widgets, and how to create entirely new widgets from scratch, with
complete control over their appearance and behavior. This chapter also shows
how to do basic graphics. Chapter 12 shows how to use Qt 4.2’s new graphics
view architecture, which is particularly suited to handling large numbers of in-
dependent graphical objects. Qt’s HTML-capable rich text engine is covered in
Chapter 13. This chapter also covers printing both to paper and to PDF files.
Part III concludes with two chapters on model/view programming: Chapter 14
introduces the subject and shows how to use Qt’s built-in views and how to
create custom data models and custom delegates, and Chapter 15 shows how
to use the model/view architecture to perform database programming.
Part IV continues the model/view theme, with coverage of three different
advanced model/view topics in Chapter 16. The first section of Chapter 17
describes the techniques that can be used for providing online help, and the
second section explains how to internationalize an application, including how
to use Qt’s translation tools to create translation files. The Python standard
library provides its own classes for networking and for threading, but in the
last two chapters of Part IV we show how to do networking and threading us-
ing PyQt’s classes.
Appendix A explains where Python, PyQt, and Qt can be obtained, and how to
install them on Windows, Mac OS X, and Linux. PyQt is much easier to learn
if you install it and try out some of the exercises, and if you inspect some of
the example code. Appendix B presents screenshots and brief descriptions
of selected PyQt widgets; this is helpful for those new to GUI programming.
Appendix C presents diagrams of some of PyQt’s key class hierarchies; this
Introduction 5
is useful for getting to know what classes PyQt has to offer and how they
are related.
If you have never used Python before, you should begin by reading Chapters
1–6 in order. If you already know Python, at least read the string policy (in
bullet points on page 28), and skim the material in Chapter 2 (apart from the
first section, which you’ll know well). Make sure that you are comfortable with
lambda and partial function application, both of which are covered in Chapter 2.
It is probably also worth skimming Chapter 3 as well. Then read Chapters 4,
5, and 6 in order.
Once you have covered the first six chapters, you have covered the essentials
of Python and the fundamentals of PyQt.
Chapter 7 is useful if you want to know how to create dialogs using a visual
design tool rather than purely by hand coding, something that can save a lot
of time. For file handling, at least read the first three sections of Chapter 8. If
you plan to write and read text files, also read Chapter 8’s fourth section, and
similarly the fifth section if you are going to use XML files.
For Part III, at the least read Chapter 10’s first section, on event handling, and
all of Chapter 11. Chapter 12 and the first section of Chapter 13 assume that
you have read about PyQt’s event handling, and that you have read Chapter 11.
Chapters 9 and 14 can be read stand-alone in this part, but Chapter 15 assumes
that you have read Chapter 14.
In Part IV, Chapter 16 assumes that you have read Chapters 14 and 15, but the
other chapters can be read independently.
If you find errors in the text or in the examples, or have other comments,
please write to [email protected] quoting “PyQt book” in the subject line. The
book’s home page, where any corrections will be published, and from where the
examples and exercise solutions can be downloaded, is http://www.qtrac.eu/
pyqtbook.html.
If you want to participate in the PyQt community, it is worthwhile joining the
mailing list. Go to http://www.riverbankcomputing.com/mailman/listinfo/pyqt to
find a link to the archive, so that you can see what the mailing list is like, and
also for a form for joining. Python also has mailing lists and other community
activities. For these, go to http://www.python.org/community.
Acknowledgments
I have many people to thank, and I will begin with those who have been
intimately involved with the book.
Jasmin Blanchette is a senior software developer at Trolltech, a Qt expert, and
a fine editor and writer in his own right. I have cowritten two C++/Qt books
with him. Jasmin has made a huge number of suggestions and criticisms that
have immensely improved the quality of this book.
6 Introduction
Python Programming
This page intentionally left blank
1
● Executing Python Code
● Variables and Objects
● Numbers and Strings
● Collections
● Built-in Functions
If you have not already installed Python and PyQt, it would be a good idea to
do so: That way you will be able to try out the examples that accompany this
book (downloadable from http://www.qtrac.eu/pyqtbook.html). See Appendix A
for installation details. One advantage of installing the software is that the
IDLE integrated development environment is installed along with Python.
9
10 Chapter 1. Data Types and Data Structures
Introduction
★
The programs in this book are written using ASCII characters, with escape sequences where Uni-
code is required. It is possible to use Latin-1, UTF-8, or other encodings for strings and comments
in Python programs, as explained in the documentation under “Encoding declarations”.
Executing Python Code 11
Assuming that we have saved the code in the file hello.py (in the directory
C:\pyqt\chap01 if using Windows), we can start up a console (click Start→All Pro-
grams→Accessories→Console on Windows XP—sometimes Console is called Com-
mand Prompt; or run Terminal.app from /Applications/Utilities on Mac OS X),
change to that directory, and execute the program like this:
C:\>cd c:\pyqt\chap01
C:\pyqt\chap01>hello.py
As long as Python is correctly installed, Windows will recognize the .py file
extension and give the file to python.exe to execute. The program will print
“Hello World” on the console as we would expect.★
On Mac OS X and Linux we must explicitly run the interpreter by typing its
name and the file’s name at the console’s prompt, like this:
% python hello.py
This will work providing that Python is installed and in your PATH. Alternative-
ly, for Linux and Mac OS X, we can add an additional “shebang” (shell execute)
comment line which tells the operating system to use a Python interpreter,
making the hello.py file two lines long:
#!/usr/bin/env python
print "Hello World"
For this to work on Mac OS X and Linux, the file’s permissions must be set
correctly. For example, at the console prompt in the same directory as the file,
enter chmod +x hello.py to make the file executable.
Python comments start with “#” and continue until the end of the line. This
means that it is perfectly safe to add the “shebang” line to all Python programs,
since the comment is ignored on Windows but on Linux it tells the operating
system to execute the file using a Python interpreter. Appendix A shows how
to associate the Python interpreter with .py and .pyw files on Mac OS X.
When we speak of executing a Python program, what happens behind the
scenes is that Python reads the .py (or .pyw) file into memory, and parses it, to
get a bytecode program that it then goes on to execute. For each module that is
imported by the program, Python first checks to see whether there is a precom-
piled bytecode version (in a .pyo or .pyc file) that has a timestamp which corre-
sponds to its .py file. If there is, Python uses the bytecode version; otherwise, it
parses the module’s .py file, saves it into a .pyc file, and uses the bytecode it just
generated. So, unlike Java, we don’t have to explicitly bytecode-compile any
modules, whether they are supplied with Python or are ones we have written
ourselves. And in most Python installations, the supplied modules are com-
★
Mac OS X users note that whenever we refer to a console, this is the same as a Mac Terminal.
12 Chapter 1. Data Types and Data Structures
>>> x = 71
>>> y = "Dove"
>>> x = 82
>>> x += 7
>>> x
89
Later on we will see cases where the fact that Python variables are object Lists
references makes a difference. ☞ 31
★
This is similar to the Java assignment, Integer x = new Integer(71); for C++ a near-equivalent
would be int xd = 71; int &x = xd;.
Exploring the Variety of Random
Documents with Different Content
The signs have been divided into four triplicities, thus: fiery , ,
; earthy, , , ; airy, , , ; and watery, , , .
Aries ( ) is a hot and fiery sign and produces a lean body, spare
and strong, large bones, grey eyes, with a quick glance and sandy or
red-coloured hair. The temper is violent. It governs the head and
face; its colour is white.
Leo ( ) is a fiery, hot and dry sign. When it rises at birth without
any planet being near the ascendant, the native will be of tall
stature, with yellow hair, ruddy complexion and oval face, and he will
have a quick glance and a strong voice. It governs the heart, the
back and the neck; its colours are red and green.
Of the seven planets Jupiter and Venus, because of the heat and
moisture predominant in them, are considered by the ancients as
benefics or causers of good. The Moon is so considered for the same
reasons, though in a less degree.
Saturn and Mars are causers of evil or malefic; the first from his
excess of cold, and the other from his excess of heat. The Sun and
Mercury are deemed of common influence—that is, either of good or
evil, according to the planets with which they are connected.
Cancer and Leo are the most northerly of all the twelve signs; they
approach nearer than the other signs to the zenith of this part of the
earth, and thereby cause warmth and heat; they are consequently
appropriated as houses for the two principal and greater luminaries;
Leo for the Sun, as being masculine; and Cancer for the Moon, as
being feminine.
Mars is dry in nature and beneath the sphere of Jupiter; he takes the
next two signs, of a nature similar to his own, viz., Aries and Scorpio,
whose relative distances from the houses of the luminaries are
injurious and discordant.
Mercury never has greater distance from the Sun than the space of
one sign, and is beneath all the other planets; hence he is nearest to
both luminaries, and the remaining two signs, Gemini and Virgo, are
allotted to him.
The "houses" of the planets are readily shown by the following table.
It is exactly the same as that found in the mummy-case of the
Archon of Thebes, in ancient Egypt, as may be seen at the British
Museum:
It will be seen, at once, from this table that the Sun and Moon have
each only one house assigned them. All planets are most powerful in
that sign which constitutes one of their houses. Planets receive
detriment in the signs opposite to those of their houses. Thus,
Saturn would receive detriment in Cancer and Leo, which are the
signs opposite to his houses, Capricornus and Aquarius. There are
some signs in which the planets are found to be very powerful,
though not to the same extent as when in their own houses; these
are called the "exaltations" of the planets, and the signs opposite to
these are those in which they receive their "fall" when they are
considered to be weak in power. Saturn has his exaltation in Libra;
his "fall" would therefore be in Aries. He governs the airy triplicity,
which is composed of the signs Gemini, Libra and Aquarius by day,
and in all the twelve signs he has these degrees (zodiacal signs)
allotted him by Ptolemy for his Terms:
In Taurus 21, 22, 23, 24, 25, 26, 27, 28, 29, 30.
In Leo 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
In Libra 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.
In Sagittarius 21, 22, 23, 24, 25, 26, 27, 28, 29, 30.
In Pisces 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
In Aries 1, 2, 3, 4, 5, 6.
In Taurus 16, 17, 18, 19, 20, 21, 22.
In Gemini 8, 9, 10, 11, 12, 13, 14.
In Cancer 7, 8, 9, 10, 11, 12, 13.
In Leo 20, 21, 22, 23, 24, 25.
In Virgo 14, 15, 16, 17, 18.
In Libra 12, 13, 14, 15, 16, 17, 18, 19.
In Scorpio 7, 8, 9, 10, 11, 12, 13, 14.
In Sagittarius 1, 2, 3, 4, 5, 6, 7, 8.
In Capricornus 13, 14, 15, 16, 17, 18, 19.
In Aquarius 21, 22, 23, 24, 25.
In Pisces 9, 10, 11, 12, 13, 14.
Of Gemini 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
Of Leo 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.
Of Libra 21, 22, 23, 24, 25, 26, 27, 28, 29, 30.
Of Capricornus 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
Of Pisces 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.
Mars has Aries for his day-house and Scorpio for his night-house. He
is exalted in Capricornus, and has his fall in Cancer.
He governs the watery Triplicity, viz., Cancer, Scorpio and Pisces, and
he has these degrees in each sign for his Terms:
In Aries 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
In Gemini 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.
In Leo 21, 22, 23, 24, 25, 26, 27, 28, 29, 30.
In Virgo 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
In Pisces 21, 22, 23, 24, 25, 26, 27, 28, 29, 30.
The Sun rules the fiery Triplicity—Aries, Leo and Sagittarius—by day.
He is exalted in the sign of Aries, and receives his fall in Libra.
He has no degrees admitted him for his Terms, but in the twelve
signs he has the following degrees for his Face:
In Aries 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.
In Gemini 21, 22, 23, 24, 25, 26, 27, 28, 29, 30.
In Virgo 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
In Scorpio 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.
In Capricornus 21, 22, 23, 24, 25, 26, 27, 28, 29, 30.
In Aries 21, 22, 23, 24, 25, 26, 27, 28, 29, 30.
In Cancer 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
In Virgo 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.
In Scorpio 21, 22, 23, 24, 25, 26, 27, 28, 29, 30.
In Pisces 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
Mercury governs the airy Triplicity, viz., Gemini, Libra and Aquarius,
by night. He has his exaltation in Virgo, and his fall in Pisces. He has
the following degrees for his Terms:
In Taurus 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
In Cancer 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.
In Virgo 21, 22, 23, 24, 25, 26, 27, 28, 29, 30.
In Sagittarius 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
In Aquarius 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.
The Moon governs the earthy Triplicity, viz., Taurus, Virgo and
Capricornus, by night.
She is exalted in Taurus, and has her fall in Scorpio. The Sun and the
Moon have no terms assigned them.
In the twelve signs she has these degrees assigned her for her Face:
In Taurus 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.
In Cancer 21, 22, 23, 24, 25, 26, 27, 28, 29, 30.
In Libra 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
In Sagittarius 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.
In Aquarius 21, 22, 23, 24, 25, 26, 27, 28, 29, 30.
A planet in his fall is very weak in his influence. The Houses count
first in dignity, then the Exaltation; afterwards the Triplicity, the
Terms, and the Faces.
The meaning of this is, if a planet is in any of the signs we call his
house or houses, he is essentially strong, and he is allowed five
dignities.
If in any of the degrees in the signs which are given as his Terms, he
has two dignities.
The planet Saturn is the most remote of the seven planetary orbs
recognised by the ancient writers on astrology. He is of a pale ash
colour, slow in motion, only finishing his course through the twelve
signs of the zodiac in 29 years and about 157 days. His greatest
north latitude from the ecliptic is 2 degrees 48 minutes; his south
latitude is 2 degrees 49 minutes.
Those born with this planet well-dignified [4] are studious, grave,
economical, prudent, patient and in all their actions sober and
somewhat austere. They are not much given to the love of women,
but they are persons of much depth of feeling, and, when they do
love, they are very constant. They are given to the study of occult
matters, [5] and are of a melancholic, suspicious and jealous
temperament. In person when well-dignified Saturn gives a rather
tall stature and long limbs. The hair is dark, the eyebrows much
marked and generally meeting between the eyes, which are dark
brown, deep set and close together. The nose is long and generally
somewhat bent over the lips and the under jaw slightly protrudes.
The complexion is sallow, the ears large and the hands and feet are
generally long, but not fleshy.
Those born under the potent aspect of Saturn are generally slow of
speech and their voices are harsh; when Saturn rises in a horoscope
devoid of dignities, the native is envious, covetous, malicious, subtle,
untruthful and of a discontented disposition. In person frequently
deformed, with long and irregular features, the eyes and hair dark
and the skin yellow and harsh.
In man's body this planet rules the spleen, the right ear, the lips and
the teeth. In illness he gives ague, palsy, ruptures (especially should
he rule in the sign of Scorpio), jaundice, toothache and all affections
of the sight, of the ear, of the teeth and jaws and of the legs.
The trees under his rule are the willow, the yew, the cypress, the
box-tree and the pine.
The beasts he governs are the elephant, the wolf, the bear, the dog,
[6] the basilisk, the crocodile, the scorpion, the serpent, the rat, the
mouse and all manner of creeping things; among birds, the crow,
the cuckoo, the raven, the owl and the bat.
Of fish he rules the eel, the tortoise and all shell fish.
The minerals he governs are lead and the dross of all metals.
His stones are jet, onyx and all dark stones which are incapable of
polish. The colour he rules is black.
He rules Saturday—the first hour after sunrise, and the eighth hour
of the same day. His number is 55. In gathering the herbs under his
rule the ancients were particular to do so in his hours, as this
rendered the medicament more powerful. This is to be observed
regarding the herbs ruled by all the planets.
Saturn's orb is nine degrees before and after any aspect; that is, his
influence begins to operate when either he applies to any planet or it
applies to him within nine degrees of his perfect aspect, and his
influence continues in force until he is separated nine degrees from
the aspect. His angel is Cassiel. His friends are Jupiter, Venus,
Mercury and the Moon; his enemies are Mars and the Sun.
Jupiter is the next planet below Saturn and is of a bright, clear, azure
colour. He much exceeds Saturn in motion, as he finishes his course
through the twelve signs in twelve years. His greatest north latitude
is 1 degree 38 minutes, and his greatest south latitude 1 degree 40
minutes. When he rises at birth well-dignified he gives an erect, tall
stature, sanguine complexion, oval face, large grey eyes, thick
brown hair, full lips and good teeth. In temperament those born
under the good influence of this planet are honourable, generous
and hospitable, but loving material pleasures, kind and affectionate
to wife and family, charitable, desiring to be well thought of and
hating all mean and sordid actions. The voices of those born under
Jupiter are clear and sonorous. When this planet rises devoid of
dignities the native will be gluttonous, profligate, vain, and boastful,
of mean abilities and shallow understanding, easily seduced to
extravagance and a tyrant to those of his family and household.
In man's body he rules the lungs and the blood, and of diseases he
gives apoplexy, gout, inflammation of the lungs, pleurisy and all
illnesses proceeding from corruption of the blood.
Of trees, he rules the mulberry, the olive, the vine, the fig, the beech
and the pear-tree.
Of beasts, the sheep, the hart, the ox and all those animals that are
useful to man.
Of birds, the stork, the snipe, the lark, the eagle, the pheasant, the
partridge and the peacock.
His stones are the sapphire, the amethyst and the emerald.
Of colours he rules red mixed with green.
His day is Thursday and he rules the first hour after sunrise and the
eighth hour. His number is 78.
The herbs over which he rules are the nettle, the thistle, onions,
scammony, garlic, horehound, cardamons, mustard and all herbs
giving heat.
Of trees, all those which are of a prickly nature, such as the holly,
the thorn and the chestnut.
Of beasts, all fierce animals—the tiger, the panther, the wolf, the
horse, the leopard, the wild ass and the bear.
Of birds, the hawk, the vulture, the kite, the eagle, the magpie and
the cock, all of which are combative.
He governs Tuesday—the first hour after sunrise, and the eighth. His
number is 39.
His friend among the planets is Venus, all the others are his
enemies.
The Sun passes through all the twelve signs of the zodiac in one
year and a few hours over the 365 days which constitute the year.
He has no latitude.
He governs the heart, the brain, the right eye and the arms; and the
diseases he causes are all illnesses of the heart, such as swoons,
palpitations, cramps, also diseases of the mouth, the brain, and the
eyes.
The plants subject to the Sun are all those of pungent odours, such
as the marigold, heliotrope, rosemary, balsam, peony, spikenard,
musk, St. John's wort, and ginger.
Of trees he rules the palm, the laurel, the cedar, the orange-tree and
the citron-tree.
Of metals, gold.
His friends are all the planets except Saturn and Mars.
His angel is Michael.
After the Sun the planet Venus succeeds in order; she is of a bright
shining colour. Her greatest north or south latitude is 2 degrees and
2 minutes. When she rises well-dignified in a nativity the person
born will be of middle stature, rather inclining to shortness, with a
beautiful complexion, light brown hair, the eyes large, of a blue or
grey colour and with a slow and rather languishing movement, red
lips, and dimples in the cheeks, chin and about the mouth. In
disposition, gracious, very tender, inclined to love-making; easy of
belief and not given to labour about anything; fond of music, plays,
and all sorts of merry-makings.
Venus governs the lower parts of the body, and the illnesses she
gives are cancer and all affections of the womb.
All the herbs she governs have a sweet smell and, generally, have
smooth leaves and white flowers, such as the lily, both white and
yellow, and the lily of the valley, also the water lily, the myrtle,
maidenhair, violets and roses.
The trees she rules are the walnut, the almond, the apple-tree, the
box-tree, the sycamore, the ash and myrtle.
Of beasts, the hart, the rabbit, the calf and all small cattle.
Of birds, the dove, the sparrow, the nightingale, the swan, the
pelican and the swallow.
Her stones, white and red coral, rubies, the beryl, turquoise and
lapis lazuli, because it expels melancholy.
Her colours are white and purple.
Her day of the week is Friday, of which she rules the first and eighth
hour after sunrise. Her number is 45.
Her friends are all the planets, but Saturn is the least sympathetic to
her.
He rules the liver, the tongue and the nerves, and the illnesses he
gives are epilepsy, giddiness, dry cough, any affection of the tongue,
and all nervous affections.
The animals are the squirrel, the weasel, the spider, the greyhound,
the fox, the ape and all cunning and quickly-moving creatures.
The birds, the parrot, the magpie, the crane, the linnet and the
swallow.
His stones all those of divers colours, white and red carnelian and
marcasite, or fire-stone.
The Moon is the nearest to the earth of all the seven planets. She
finishes her course through the whole twelve signs in 27 days 7
hours and 36 seconds. Her greatest north latitude is 5 degrees and
about 17 minutes, her greatest south latitude 5 degrees and 12
minutes.
When she rises well-placed in a horoscope, she signifies a person of
soft and gentle manners, timid, imaginative, loving pleasure and
ease, yet fond of moving from place to place, rather capricious, but
of a poetic and romantic turn of mind. In person, those born under
good aspects of the Moon are of middle height, with a round head
and face, pale, soft skin, large light eyes, usually one a little larger
than the other. The whole body inclined to be fleshy, the lips full,
and the hair of a dull, light colour, but not at all inclined to gold.
The Moon governs the left side and the bladder. She gives dropsy, all
cold and rheumatic diseases, colds or hurts in the eyes, convulsive
fits, hysteria, and feminine weaknesses.
The plants she governs are all those which have soft, juicy leaves,
such as the lettuce, the melon, the gourd, the poppy, mushroom,
cabbage and colewort. Of trees, all those which have round,
spreading leaves, such as the lime-tree and the sycamore.
The beasts she rules are those which love the water, as the otter
and the seal.
She rules all sea fowl and also the goose, the duck and the night
owl.
Her friends are Venus, Jupiter, the Sun, Saturn and Mercury.
The First House.—This is called the Ascendant, and the planet rising
therein—whether well or ill-dignified—will materially affect the mind,
bodily appearance and fate of the native through his whole
existence. This house is masculine, and governs the head and face
of man and, if the planet Mars be in this house at the time of birth,
there will always be some blemish or mole in the face of the native;
if a few out of the degrees have ascended the scar or blemish is,
without fail, on the upper part of the head; if the middle part of the
sign ascends the mark is in the middle of the face; if the latter part
of the sign is ascending the mark is near the chin. This house
represents the head, the tongue and the memory, and it governs in
colours white.
The Fifth House.—This signifies the children of the native, also his
success in speculation and hazardous games, the pleasures he
enjoys and the wealth of the father. It rules the heart, back and liver,
is masculine, and represents in colour black and white mixed.
The Eighth House argues of death, of legacies and wills, also of the
kind of death a man shall die; it is a feminine house. It rules the
lower parts of the trunk of the body; its colours are green and black.
The Ninth House gives judgment on voyages and long journeys, and
also on events happening to the wife's kindred. It rules the hips and
thighs. It is a masculine house; its colours are green and white.
The Twelfth House.—This house is often called the Evil Dæmon, for
it is the house of sorrow, self-undoing, enemies and imprisonment.
It governs great cattle. It is feminine, and rules the feet and toes,
and in colour it governs green.
The strongest houses are the first (the Ascendant) and the tenth
(the Mid-heaven). The first, fourth, seventh, and tenth are called
Angular Houses, and represent the four cardinal points of the
compass; thus the first is east, the seventh west, the fourth is north,
and the tenth south. The second, fifth, eighth, and eleventh houses
are called Succedent Houses; the third, sixth, ninth, and twelfth
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com