View Full Version : Please help with error message


Sydney's Mom
01-11-2009, 02:24 PM
:help:
My husband bet me I cannot get a script I found on the net to work. I was looking for ereader2html. I copied, deleted some stuff at the top, saved as a py text file, and this is what I get:


C:\Python26>ereader2html.py
eReader2Html v0.03. Copyright (c) 2008 The Dark Reverser
Traceback (most recent call last):
File "C:\Python26\Tools\Scripts\ereader2html.py", line 473, in <module>
if len(sys.argv)!=5:
NameError: name 'sys' is not defined

Since it is finding the error in line 473, I am assuming that everything above is okay?

I know absolutely nothing about programing, but I was dared (yes, I would jump off a building if someone dared me!). And I have enjoyed reading these forums and learning something new. So if someone could start me down this programing path, who knows where it will lead!

Thanks, Debra

wallcraft
01-11-2009, 02:41 PM
I think you deleted one too many lines. The first non-comment line of the script starts with import, and this line includes sys which seems to be missing. The "#" lines are just comments and can stay too, i.e. try again without deleting lines.

Sydney's Mom
01-11-2009, 03:11 PM
Wallcraft, I may be there! I will think of you when my husband takes me to dinner!

Here is what I get. Does this look okay? I don't understand the deprecation warning.

C:\Python26>ereader2html.py
C:\Python26\Tools\Scripts\ereader2html.py:10: DeprecationWarning: the sha module
is deprecated; use the hashlib module instead
import struct, binascii, zlib, os, sha, sys, os.path
eReader2Html v0.03. Copyright (c) 2008 The Dark Reverser
Converts eReader books to HTML
Usage:
ereader2html infile.pdb outdir "your name" credit_card_number
Note:
It's enough to enter the last 8 digits of the credit card number

Thanks, Debra

pilotbob
01-11-2009, 03:13 PM
My husband bet me I cannot get a script I found on the net to work. I was looking for ereader2html.

Nice vote of confidence.

But, why are you editing the script at all?

BOb

wallcraft
01-11-2009, 03:23 PM
Here is what I get. Does this look okay? I don't understand the deprecation warning. Ignore the warning. This is exactly what you should get from the script with no arguments.

Sydney's Mom
01-11-2009, 03:28 PM
When I put it in as is (just changing the name) I got the error messages. But putting it in as is, I get the deprecation warning.

BTW, my husband is a VP at a computer software company. But he is an engineer, not a programer, although he has programers working for him. I asked him to ask one of his guys to do it (he has 2 women, 18 men), but he refused. As he should - they aren't paid to do my stuff. But I sure would like to show him up and having a working script by the time he gets back from China (doing some programing stuff there).

Sydney's Mom
01-11-2009, 03:35 PM
I did enter arguments. I ran it as follows from C:\users\debra\documents\my ebooks

ereader2html.py book.pdb "my name" [last 8 digits CC]

Sydney's Mom
01-11-2009, 03:39 PM
And

import struct, binascii, zlib, os, sha, sys, os.path

Is exactly what it says in the script I saved. So what am I doing wrong?

wallcraft
01-11-2009, 03:58 PM
ereader2html.py book.pdb "my name" [last 8 digits CC] There is one argument missing ereader2html infile.pdb outdir "your name" credit_card_number
where outdir is the subdirectory where you want the HTML and images to go. This does not have to exist yet.

Sydney's Mom
01-11-2009, 04:01 PM
Thanks for all the help, Wallcraft. Here is the argument that gets the same old error message:


C:\Python26\Tools\Scripts>ereader2html.py CaughtStealing_78249.pdb C:users\debra
\documents\my ebooks\ "name" [last 8 digets of cc]

wallcraft
01-11-2009, 04:06 PM
Try: ereader2html.py CaughtStealing_78249.pdb CaughtStealing "name" [last 8 digets of cc] This will create a directory CaughtStealing in your current location. You can move it to my ebooks later.

Sydney's Mom
01-11-2009, 04:12 PM
Getting Close! It says incorrect name of CC#. I will go back to fictionwise and see what is says.

Sydney's Mom
01-11-2009, 04:19 PM
PROCESSING . . . DONE

Priceless. :thanks:

Thank you, thank you, thank you, Wallcraft. Now I can find a program to convert to azw (I will see what the Amazon conversion looks like).

I cannot wait to tell my husband!!!! Debra

wallcraft
01-11-2009, 04:25 PM
Now I can find a program to convert to azw Windows MobiPocket Reader can import the HTML and produce a MOBI ebook for you. It will end up in the MobiPocket directory (by default this is My Documents\My eBooks).

Sydney's Mom
01-11-2009, 04:31 PM
Thanks! I got it back from Amazon, tried Auto Ebook Kindle Converter, and I will try Mobile Reader. I will post the one that has the best formatting.

Sydney's Mom
01-11-2009, 04:41 PM
They all look the same! Beautiful! Thanks for all the help!

pilotbob
01-11-2009, 05:08 PM
Thanks! I got it back from Amazon, tried Auto Ebook Kindle Converter, and I will try Mobile Reader. I will post the one that has the best formatting.

You could also just email it to your free Kindle email address and they will return is converted for you.

BOb

Sydney's Mom
01-11-2009, 05:58 PM
Yes, that is what I use. I connected the computer, transferred all three, and they were identical. Amazon must use the very same software!

Sydney's Mom
01-11-2009, 06:04 PM
Look what my husband sent from China in response to my telling him of my success:

You’re hired! What a hacker--

The sarcasm comes through loud and clear.