Python GUI Programming Cookbook Use recipes to develop responsive and powerful GUIs using Tkinter 2nd Edition Meier Burkhard A download
Python GUI Programming Cookbook Use recipes to develop responsive and powerful GUIs using Tkinter 2nd Edition Meier Burkhard A download
https://ebookmeta.com/product/python-3-programming-and-guis-for-
electronic-engineers-2nd-edition-andrew-pratt/
https://ebookmeta.com/product/hands-on-gui-programming-with-c-
and-qt5-build-stunning-cross-platform-applications-and-widgets-
with-the-most-powerful-gui-framework-1st-edition-eng-lee-zhi/
https://ebookmeta.com/product/building-modern-web-applications-
with-asp-net-core-blazor-learn-how-to-use-blazor-to-create-
powerful-responsive-and-engaging-web-applications-brian-ding/
https://ebookmeta.com/product/nutrition-for-healthy-hair-guide-
to-understanding-and-proper-practice-ralph-m-trueb/
Raising the Bar A Curvy Woman Office Romance 1st
Edition C.L. Cruz [Cruz
https://ebookmeta.com/product/raising-the-bar-a-curvy-woman-
office-romance-1st-edition-c-l-cruz-cruz/
https://ebookmeta.com/product/yu-gi-oh-3-in-1-edition-
vol-10-includes-vols-28-29-30-kazuki-takahashi/
https://ebookmeta.com/product/cheating-in-paradise-1st-edition-
thorne-jaime/
https://ebookmeta.com/product/lonely-planet-pocket-tenerife-2nd-
edition-lonely-planet/
https://ebookmeta.com/product/generalized-mercer-kernels-and-
reproducing-kernel-banach-spaces-1st-edition-yuesheng-xu/
Origins The Scientific Story of Creation Baggott Jim
https://ebookmeta.com/product/origins-the-scientific-story-of-
creation-baggott-jim/
Python GUI Programming
Cookbook
Second Edition
programming language
Burkhard A. Meier
BIRMINGHAM - MUMBAI
Second Edition
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78712-945-0
www.packtpub.com
Credits
Author
Copy Editor
Burkhard A. Meier
Muktikant Garimella
Reviewer
Project Coordinator
Mohit
Ulhas Kambali
Commissioning Editor
Proofreader
Kunal Parikh
Safis Editing
Acquisition Editor
Indexer
Denim Pinto
Aishwarya Gangawane
Graphics
Anurag Ghogre
Abhinash Sahu
Technical Editor
Production Coordinator
Prashant Mishra
Nilesh Mohite
You can get in touch with him through his LinkedIn account,
https://www.linkedin.com
/pub/burkhard-meier/5/246/296.
I would like to thank all truly great artists, such as Leonardo da Vinci,
Charles Baudelaire, Edgar Allan Poe, and so many more for bringing
the presence of beauty into our human lives. This book is about
creating very beautiful GUIs written in the Python programming
language, and it was inspired by these truly great artists.
I would like to thank all of the great people that made this book
possible. Without any of you, this book would only exist in my mind. I
would like to especially thank all of my editors at Packt Publishing:
Sonali, Anurag, Prashant, Vivek, Arwa, Sumeet, Saurabh, Pramod,
Nikhil, and so many more. I would also like to thank all of the
reviewers of the code of this book. Without them, this book would be
harder to read and apply to real-world problems. Last but not least,
I'd like to thank my wife, our daughter, and our parents for the
emotional support they provided so successfully during the writing of
the second edition of this book. I'd also like to give thanks to the
creator of the very beautiful and powerful programming language
that Python truly is. Thank you Guido.
For support files and downloads related to your book, please visit
www.PacktPub.com.
Did you know that Packt offers eBook versions of every book
published, with PDF and ePub files available? You can upgrade to the
eBook version at www.PacktPub.com and as a print book customer,
you are entitled to a discount on the eBook copy. Get in touch with us
at service@packtpub.com for more details.
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full
access to all Packt books and video courses, as well as industry-
leading tools to help you plan your personal development and
advance your career.
Why subscribe?
If you'd like to join our team of regular reviewers, you can e-mail us
at customerreviews@packtpub.com. We award our regular reviewers
with free eBooks and videos in exchange for their valuable feedback.
Help us be relentless in improving our products!
Table of Contents
Preface
Introduction
Getting ready
How to do it…
10
How it works…
10
There's more…
11
12
Getting ready
12
How to do it…
12
How it works…
13
14
Getting ready
14
How to do it…
14
How it works…
15
There's more…
16
16
Getting ready
17
How to do it…
17
How it works…
18
There's more…
18
19
Getting ready
19
How to do it…
19
How it works…
20
Getting ready
21
How to do it…
21
How it works…
23
There's more…
23
24
Getting ready
24
How to do it…
24
How it works…
25
There's more…
26
Getting ready
26
How to do it…
27
How it works…
28
28
Getting ready
29
How to do it…
29
How it works…
30
There's more…
31
31
Getting ready
31
How to do it…
32
How it works…
33
34
Getting ready
34
How to do it…
34
How it works…
35
There's more…
35
36
Introduction
36
These lines are capital, and are a fine copy, which can only
appear tame by the original having been before our eyes, painted by
the great master, the Creator and Ruler of the world.
The simoom, with the wind at S. E. immediately follows the
wind at N. and the usual despondency that always accompanied it.
The blue meteor, with which it began, passed over us about twelve,
and the rustling wind that followed it continued till near two. Silence,
and a desperate kind of indifference about life, were the immediate
effects upon us; and I began now, seeing the condition of my
camels, to fear we were all doomed to a sandy grave, and to
contemplate it with some degree of resignation. At half past eight in
the evening we alighted in a sandy flat, where there was great store
of bent grass and trees which had a considerable degree of verdure,
a circumstance much in favour of our camels. We determined to stop
here to give them an opportunity of eating their fill where they could
find it.
On the 22d, at six o'clock we set out from the sandy flat, and
one of the Tucorory was seized with a phrenzy or madness. At first I
took it for a fit of the epilepsy, by the distortions of his face, but it
was soon seen to be of a more serious nature. Whether he had been
before afflicted with it I know not. I offered to bleed him, which he
refused; neither, though we gave him water, would he drink, but
very moderately. He rolled upon the ground, and moaned, often
repeating two or three words which I did not understand. He refused
to continue his journey, or rise from where he lay, so that we were
obliged to leave him to his fortune. We went this day very diligently,
not remarkably slow nor fast; but though our camels, as we thought,
had fared well for these two nights, another of them died about four
o'clock this afternoon, when we came to Umarack.
I here began to provide for the worst. I saw the fate of our
camels approaching, and that our men grew weak in proportion; our
bread, too, began to fail us, altho' we had plenty of camels flesh in
its stead; our water, though in all appearance we were to find it
more frequently than in the beginning of our journey, was
nevertheless brackish, and scarce served the purpose to quench our
thirst; and, above all, the dreadful simoom had perfectly exhausted
our strength, and brought upon us a degree of cowardice and
languor that we struggled with in vain; I therefore, as the last effort,
began to throw away every thing weighty I could spare, or that was
not absolutely necessary, such as all shells, fossiles, minerals, and
petrefactions that I could get at, the counter-cases of my quadrant,
telescopes, and clock, and several suchlike things.
Our camels were now reduced to five, and it did not seem that
these were capable of continuing their journey much longer. In that
case, no remedy remained, but that each man should carry his own
water and provisions. Now, as no one man could carry the water he
should use between well and well, and it was more than probable
that distance would be doubled by some of the wells being found
dry; and if that was not the case, yet, as it was impossible for a man
to carry his provisions who could not walk without any burden at all,
our situation seemed to be most desperate.
The Bishareen alone seemed to keep up his strength, and was
in excellent spirits. He had attached himself, in a particular manner,
to me, and with a part of that very scanty rag which he had round
his waist he had made a wrapper, very artificially, according to the
manner his countrymen the Bishareen practice on such occasions.
This had greatly defended my feet in the day, but the pain
occasioned by the cold in the night was really scarce sufferable. I
offered to free him from the confinement of his left hand, which was
chained to some one of the company night and day; but he very
sensibly refused it, saying, "Unchain my hands when you load and
unload your camels, I cannot then run away from you; for tho' you
did not shoot me, I should starve with hunger and thirst; but keep
me to the end of the journey as you began with me, then I cannot
misbehave, and lose the reward which you say you are to give me."
At forty minutes past three o'clock we saw large stratas of
fossile salt everywhere upon the surface of the ground. At five we
found the body of Mahomet Towash, on the spot where he had been
murdered, stript naked, and lying on his face unburied. The wound
in the back-sinew of his leg was apparent; he was, besides, thrust
through the back with a lance, and had two wounds in the head with
swords. We followed some footsteps in the sand to the right, and
there saw three other bodies, whom Idris knew to be his principal
servants. These, it seemed, had taken to their arms upon the Aga's
being first wounded, and the cowardly, treacherous Bishareens had
persuaded them to capitulate upon promise of giving them camels
and provision to carry them into Egypt, after which they had
murdered them behind these rocks.
At six o'clock we alighted at Umarack, so called from a number
of rack-trees that grow there, and which seem to affect a saltish soil;
at Raback and Masuah I had seen them growing in the sea. When I
ordered a halt at Umarack, the general cry was, to travel all night, so
that we might be at a distance from that dangerous, unlucky spot.
The sight of the men murdered, and fear of the like fate, had got the
better of their other sensations. In short, there was nothing more
visible, than that their apprehensions were of two sorts, and
produced very different operations. The simoom, the stalking pillars
of sand, and probability of dying with thirst or hunger, brought on a
torpor, or indifference, that made them inactive; but the discovery of
the Arab at Terfowey, the fear of meeting the Bishareen at the wells,
and the dead bodies of the Aga and his unfortunate companions,
produced a degree of activity and irritation that resembled very
much their spirits being elevated by good news. I told them, that, of
all the places in the desert through which they had passed, this was
by far the safest, because fear of being met by troops from Assouan,
seeking the murderers of Mahomet Towash would keep all the
Bishareen at a distance. Our Arab said, that the next well belonged
to the Ababdé, and not the Bishareen, and that the Bishareen had
slain the Aga there, to make men believe it had been done by the
Ababdé. Idris contributed his morsel of comfort, by assuring us, that
the wells now, as far as Egypt, were so scanty of water, that no
party above ten men would trust their provision to them, and none
of us had the least apprehension from marauders of twice that
number. The night at Umarack was excessively cold as to sensation;
Fahrenheit's thermometer was however at 49° an hour before day-
light.
On the 23d we left Umarack at six o'clock in the morning, our
road this day being between mountains of blue stones of a very fine
and perfect quality, through the heart of which ran thick veins of
jasper, their strata perpendicular to the horizon. There were other
mountains of marble of the colour called Isabella. In other places the
rock seemed composed of petrified wood, such as we had seen in
the mountains near Cosseir. At a quarter past eleven, going due N.
we entered a narrow valley, in which we passed two wells on our
left, and following the windings through this valley, all of deep sand,
we came to a large pool of excellent water, called Umgwat, sheltered
from the rays of the sun by a large rock which projected over it, the
upper part of which was shaped like a wedge, and was composed all
of green marble, without the smallest variety or spot of other colour
in it.
Through this whole valley, to-day, we had seen the bodies of
the Tucorory who had followed Mahomet Towash, and been
scattered by the Bishareen, and left to perish with thirst there. None
of them, however, as far as we could observe, had ever reached this
well. In the water we found a bird of the duck kind called Teal, or
Widgeon. The Turk Ismael was preparing to shoot at it with his
blunderbuss, but I desired him to refrain, being willing, by its flight,
to endeavour to judge something of the nearness of the Nile. We
raised it therefore by sudden repeated cries, which method was
likely to make it seek its home straight, and abandon a place it must
have been a stranger to. The bird flew straight west, rising as he
flew, a sure proof his journey was a long one, till at last, being very
high and at a distance, he vanished from our sight, without
descending or seeking to approach the earth; from which I drew an
unpleasant inference that we were yet far from the Nile, as was
really the case.
Here we threw away the brackish water that remained in our
girbas, and filled them with the wholesome element drawn from this
pool of Umgwat. I could not help reproaching Idris with the
inaccuracy of the information he had pretended to give us the day
before, that no party above ten men could meet us at any of these
wells, as none of them could supply water for more; whereas in this
pool there was certainly enough of excellent water to serve a whole
tribe of Arabs for a month. He had little to say, further than that
Haimer, though near, was a scanty well, and perhaps we should not
find water there at all. He trusted, however, if our people would take
heart, we were out of all danger from Arabs, or any thing else.
At a quarter past three we left the well, and continued along a
sandy valley, which is called Waadi Umgwat. This night it was told
me that Georgis, and the Turk Ismael, were both so ill, and so
desponding, that they had resolved to pursue the journey no farther,
but submit to their destiny, as they called it, and stay behind and
die. It was with the utmost difficulty I could get them to lay aside
this resolution, and the next morning I promised they should ride by
turns upon one of the camels, a thing that none of us had yet
attempted. They had, indeed, often desired me to do so, but I well
knew, if I had set them that example, besides destroying the camels,
it would have had the very worst effect upon their dastardly spirits;
and, indeed, we very soon saw the bad effects of this humane
consideration for the two invalids.
On the 24th, at half past six in the morning we left Umgwat,
following the windings of sandy valleys between stony hills. At half
past nine we found Mahomet Aga's horse dead. The poor creature
seemed, without a guide, to have followed exactly enough the tract
of the wells and way to Egypt, and had survived all his fellow-
travellers. At eleven o'clock we came to some plains of loose, moving
sand, and saw some pillars in motion, which had not wind to sustain
them for any time, and which gave us, therefore, little concern. At
one we alighted near the well Mour, which was to the N. E. of us. At
four we left the well Mour: At forty minutes after four passed the
well itself, which was then dry; and at a quarter past six we found a
dead man, whose corpse was quite dry, and had been so a
considerable time. At seven o'clock in the evening we alighted at El
Haimer, where are the two wells in a large plain of sand. The water
is good. There is another well to the west of us, but it is bitter and
saltish, though more abundant than either of the other two, which,
by filling our skins, we had several times drained.
On the 25th, at half past seven in the morning we left the well
El Haimer, and at ten o'clock alighted among some acacia-trees, our
camels having ate nothing all night, except the dry bitter roots of
that drug, the senna. While we were attending the camels, and
resting ourselves on the grass, we were surprised at the appearance
of a troop of Arabs all upon camels, who looked like a caravan, each
camel having a small loading behind him. They had two gentle
ascents before they could arrive at the place where we were. The
road is between two sandy hills, at the back of which our camels
were feeding in a wood; and near the road was the well El Haimer,
where our skins were lying full of water. It was necessary then to
understand one another before we allowed them to pass between
the sandy hills. Upon the first alarm, my people all repaired to me,
bringing their arms in their hands, as well those that they carried
upon them, as the spare arms, all of which were primed and
charged.