Enhanced Swindle Sample Run

This depicts a single run of the enhancedEreader.py file. Commentary about the run is interspersed throughout. Notice that the initial interaction with the ereader is the same as before.

$ python3 enhancedEreader.py 

Since this is the first time you used it, 
let's customize your Swindle...

Please enter you name: William

Welcome to William's Swindle v1.0!

--------------------------------------------------

1) Buy/See available books
2) See owned books
3) Read a book
4) Exit

   ---> 1

Available books:
 1:       Alice in Wonderland by        Lewis Carroll (1865)
 2:       Pride and Prejudice by          Jane Austin (1813)
 3:                 Peter Pan by         J. M. Barrie (1922)
 4:                   Ulysses by          James Joyce (1922)
 5:    Mary Had a Little Lamb by   Sarah Josepha Hale (1830)

Which book would you like to buy? (0 to skip): 4

You've successfully purchased the book: Ulysses

--------------------------------------------------

1) Buy/See available books
2) See owned books
3) Read a book
4) Exit

   ---> 1

Available books:
 1:       Alice in Wonderland by        Lewis Carroll (1865)
 2:       Pride and Prejudice by          Jane Austin (1813)
 3:                 Peter Pan by         J. M. Barrie (1922)
 4:    Mary Had a Little Lamb by   Sarah Josepha Hale (1830)

Which book would you like to buy? (0 to skip): 2

You've successfully purchased the book: Pride and Prejudice

--------------------------------------------------

1) Buy/See available books
2) See owned books
3) Read a book
4) Exit

   ---> 3

Books you own:
 1:                   Ulysses by          James Joyce (1922)
 2:       Pride and Prejudice by          Jane Austin (1813)

Which book would you like to read? (0 to skip): 2




Pride and Prejudice

by Jane Austen




Chapter 1


It is a truth universally acknowledged, that a single man in
possession of a good fortune, must be in want of a wife.

However little known the feelings or views of such a man may
be on his first entering a neighbourhood, this truth is so well
fixed in the minds of the surrounding families, that he is considered

Showing page 0 out of 711

n (next); p (previous); q (quit): n

the rightful property of some one or other of their daughters.

"My dear Mr. Bennet," said his lady to him one day, "have you
heard that Netherfield Park is let at last?"

Mr. Bennet replied that he had not.

"But it is," returned she; "for Mrs. Long has just been here, and
she told me all about it."

Mr. Bennet made no answer.

"Do you not want to know who has taken it?" cried his wife
impatiently.

"_You_ want to tell me, and I have no objection to hearing it."

This was invitation enough.

"Why, my dear, you must know, Mrs. Long says that Netherfield

Showing page 1 out of 711

n (next); p (previous); q (quit): n

is taken by a young man of large fortune from the north of
England; that he came down on Monday in a chaise and four to
see the place, and was so much delighted with it, that he agreed
with Mr. Morris immediately; that he is to take possession
before Michaelmas, and some of his servants are to be in the
house by the end of next week."

"What is his name?"

"Bingley."

"Is he married or single?"

"Oh!  Single, my dear, to be sure!  A single man of large
fortune; four or five thousand a year.  What a fine thing for our
girls!"

"How so?  How can it affect them?"

"My dear Mr. Bennet," replied his wife, "how can you be so

Showing page 2 out of 711

n (next); p (previous); q (quit): q

Setting bookmark in Pride and Prejudice at page 2

--------------------------------------------------

1) Buy/See available books
2) See owned books
3) Read a book
4) Exit

   ---> 4

When the user exits the ereader, the current status of all of the books is saved. This includes the books that are still available and the books that are owned (and their current page numbers).

Notice that when the user of the ereader runs the program again, the program recognizes this is not the first time and welcomes the user back.

$ python3 enhancedEreader.py

Welcome back William!
--------------------------------------------------

1) Buy/See available books
2) See owned books
3) Read a book
4) Exit

   ---> 2

Books you own:
 1:                   Ulysses by          James Joyce (1922)
 2:       Pride and Prejudice by          Jane Austin (1813)



--------------------------------------------------

1) Buy/See available books
2) See owned books
3) Read a book
4) Exit

   ---> 3

Books you own:
 1:                   Ulysses by          James Joyce (1922)
 2:       Pride and Prejudice by          Jane Austin (1813)

Which book would you like to read? (0 to skip): 2

is taken by a young man of large fortune from the north of
England; that he came down on Monday in a chaise and four to
see the place, and was so much delighted with it, that he agreed
with Mr. Morris immediately; that he is to take possession
before Michaelmas, and some of his servants are to be in the
house by the end of next week."

"What is his name?"

"Bingley."

"Is he married or single?"

"Oh!  Single, my dear, to be sure!  A single man of large
fortune; four or five thousand a year.  What a fine thing for our
girls!"

"How so?  How can it affect them?"

"My dear Mr. Bennet," replied his wife, "how can you be so

Showing page 2 out of 711

n (next); p (previous); q (quit): n

Notice that the enhanced ereader correctly returns to the page where William left off reading this book the last time.

tiresome!  You must know that I am thinking of his marrying
one of them."

"Is that his design in settling here?"

"Design!  Nonsense, how can you talk so!  But it is very likely
that he _may_ fall in love with one of them, and therefore you
must visit him as soon as he comes."

"I see no occasion for that.  You and the girls may go, or you
may send them by themselves, which perhaps will be still
better, for as you are as handsome as any of them, Mr. Bingley
may like you the best of the party."

"My dear, you flatter me.  I certainly _have_ had my share of
beauty, but I do not pretend to be anything extraordinary now.
When a woman has five grown-up daughters, she ought to give
over thinking of her own beauty."

"In such cases, a woman has not often much beauty to think of."

Showing page 3 out of 711

n (next); p (previous); q (quit): q

Setting bookmark in Pride and Prejudice at page 3

--------------------------------------------------

1) Buy/See available books
2) See owned books
3) Read a book
4) Exit

   ---> 1

Available books:
 1:       Alice in Wonderland by        Lewis Carroll (1865)
 2:                 Peter Pan by         J. M. Barrie (1922)
 3:    Mary Had a Little Lamb by   Sarah Josepha Hale (1830)

Which book would you like to buy? (0 to skip): 1

You've successfully purchased the book: Alice in Wonderland

--------------------------------------------------

1) Buy/See available books
2) See owned books
3) Read a book
4) Exit

   ---> 3

Books you own:
 1:                   Ulysses by          James Joyce (1922)
 2:       Pride and Prejudice by          Jane Austin (1813)
 3:       Alice in Wonderland by        Lewis Carroll (1865)

Which book would you like to read? (0 to skip): 3


CHAPTER I. Down the Rabbit-Hole

Alice was beginning to get very tired of sitting by her sister on the
bank, and of having nothing to do: once or twice she had peeped into the
book her sister was reading, but it had no pictures or conversations in
it, 'and what is the use of a book,' thought Alice 'without pictures or
conversation?'

So she was considering in her own mind (as well as she could, for the
hot day made her feel very sleepy and stupid), whether the pleasure
of making a daisy-chain would be worth the trouble of getting up and
picking the daisies, when suddenly a White Rabbit with pink eyes ran
close by her.

There was nothing so VERY remarkable in that; nor did Alice think it so
VERY much out of the way to hear the Rabbit say to itself, 'Oh dear!
Oh dear! I shall be late!' (when she thought it over afterwards, it
occurred to her that she ought to have wondered at this, but at the time

Showing page 0 out of 166

n (next); p (previous); q (quit): n

it all seemed quite natural); but when the Rabbit actually TOOK A WATCH
OUT OF ITS WAISTCOAT-POCKET, and looked at it, and then hurried on,
Alice started to her feet, for it flashed across her mind that she had
never before seen a rabbit with either a waistcoat-pocket, or a watch
to take out of it, and burning with curiosity, she ran across the field
after it, and fortunately was just in time to see it pop down a large
rabbit-hole under the hedge.

In another moment down went Alice after it, never once considering how
in the world she was to get out again.

The rabbit-hole went straight on like a tunnel for some way, and then
dipped suddenly down, so suddenly that Alice had not a moment to think
about stopping herself before she found herself falling down a very deep
well.

Either the well was very deep, or she fell very slowly, for she had
plenty of time as she went down to look about her and to wonder what was
going to happen next. First, she tried to look down and make out what
she was coming to, but it was too dark to see anything; then she

Showing page 1 out of 166

n (next); p (previous); q (quit): q

Setting bookmark in Alice in Wonderland at page 1

--------------------------------------------------

1) Buy/See available books
2) See owned books
3) Read a book
4) Exit

   ---> 4

On the second interaction with the enhanced ereader, the user buys an additional book and begins reading it. The next time the user opens the ereader, this updated information is recognized and used appropriately.


$ python3 enhancedEreader.py 

Welcome back William!
--------------------------------------------------

1) Buy/See available books
2) See owned books
3) Read a book
4) Exit

   ---> 3

Books you own:
 1:                   Ulysses by          James Joyce (1922)
 2:       Pride and Prejudice by          Jane Austin (1813)
 3:       Alice in Wonderland by        Lewis Carroll (1865)


Which book would you like to read? (0 to skip): 3

it all seemed quite natural); but when the Rabbit actually TOOK A WATCH
OUT OF ITS WAISTCOAT-POCKET, and looked at it, and then hurried on,
Alice started to her feet, for it flashed across her mind that she had
never before seen a rabbit with either a waistcoat-pocket, or a watch
to take out of it, and burning with curiosity, she ran across the field
after it, and fortunately was just in time to see it pop down a large
rabbit-hole under the hedge.

In another moment down went Alice after it, never once considering how
in the world she was to get out again.

The rabbit-hole went straight on like a tunnel for some way, and then
dipped suddenly down, so suddenly that Alice had not a moment to think
about stopping herself before she found herself falling down a very deep
well.

Either the well was very deep, or she fell very slowly, for she had
plenty of time as she went down to look about her and to wonder what was
going to happen next. First, she tried to look down and make out what
she was coming to, but it was too dark to see anything; then she

Showing page 1 out of 166

n (next); p (previous); q (quit): n

looked at the sides of the well, and noticed that they were filled with
cupboards and book-shelves; here and there she saw maps and pictures
hung upon pegs. She took down a jar from one of the shelves as
she passed; it was labelled 'ORANGE MARMALADE', but to her great
disappointment it was empty: she did not like to drop the jar for fear
of killing somebody, so managed to put it into one of the cupboards as
she fell past it.

'Well!' thought Alice to herself, 'after such a fall as this, I shall
think nothing of tumbling down stairs! How brave they'll all think me at
home! Why, I wouldn't say anything about it, even if I fell off the top
of the house!' (Which was very likely true.)

Down, down, down. Would the fall NEVER come to an end! 'I wonder how
many miles I've fallen by this time?' she said aloud. 'I must be getting
somewhere near the centre of the earth. Let me see: that would be four
thousand miles down, I think--' (for, you see, Alice had learnt several
things of this sort in her lessons in the schoolroom, and though this
was not a VERY good opportunity for showing off her knowledge, as there
was no one to listen to her, still it was good practice to say it over)

Showing page 2 out of 166

n (next); p (previous); q (quit): q

Setting bookmark in Alice in Wonderland at page 2

--------------------------------------------------

1) Buy/See available books
2) See owned books
3) Read a book
4) Exit

   ---> 4

The enhanced ereader saves the current status of all of the books each time the user exits.