View Single Post
Old 11-02-2008, 04:54 AM   #53
petermillard
Evangelist
petermillard ought to be getting tired of karma fortunes by now.petermillard ought to be getting tired of karma fortunes by now.petermillard ought to be getting tired of karma fortunes by now.petermillard ought to be getting tired of karma fortunes by now.petermillard ought to be getting tired of karma fortunes by now.petermillard ought to be getting tired of karma fortunes by now.petermillard ought to be getting tired of karma fortunes by now.petermillard ought to be getting tired of karma fortunes by now.petermillard ought to be getting tired of karma fortunes by now.petermillard ought to be getting tired of karma fortunes by now.petermillard ought to be getting tired of karma fortunes by now.
 
petermillard's Avatar
 
Posts: 496
Karma: 2384998
Join Date: Aug 2007
Location: London, UK
Device: iPad, iPhone, K3 & Amazon - between them they cover my needs.
Myral, looks like you're doing OK, just getting snagged on a couple of points.

This is what worked for me:-

OK, so you've downloaded and installed python into "Python25" folder - I'd leave it there; as pilotbob says, you don't need to move it anywhere. And you've downloaded the script - rename this, removing the ".txt" and replacing it with ".py" - this tells your operating system that it's a python script, and the icon will change accordingly; if it doesn't, there's something wrong. As others have said, according to your example, it looks like you've added '.py' into the filename, not replaced it.

So, you should now have a small file called (e.g.) "yourscriptname.py" on your computer. Copy this into your "Python25" folder, along with the ebook you want to convert - I find keeping it all in c:\python25 makes the filepaths easier to manage, especially if this command-line stuff is all new to you.

And you've managed to get a DOS window open and functioning; now you need to point it at the directory where your scripts and books are, using the command "CD" - stands for "Change Directory" - followed by a space, then the path to your directory. It isn't case-sensitive, but the spaces, colons and back-slashes are important. So if your scripts and books are in c:\python25, you type this:-

cd c:\python25

then hit return. Now you should have another line of text in the window like this

C:\Python25>

Directly after the ">" prompt, type "yourscriptnamel.py" (no quotes, no spaces) and hit return. You should get a few lines of text giving creator & copyright information, and "usage' which has five distinct parts, or parameters, each separated by a space. I've listed them line-by-line here for clarity:-

yourscriptname - you need to type this with the extension ".py" to make DOS find and run the script
infile.pdb - this is the name of the book you want to convert
outdir - this is the folder you want the converted book to be saved to
"your name" - this is your name written exactly as it was when you bought the book, contained in quotation marks; the quote marks are important, so don't miss them out!
credit_card_number - as the script says, it's enough to enter the last 8 digits of the credit-card used.

So in this example:-

C:\Python25>ereader2html.py blackmonday.pdb c:\python25 "James Bond" 00700700

Somebody called James Bond is converting the book blackmonday.pdb using the ereader2html.py script and saving the converted files back to the python25 folder using his highly improbaby credit-card number.

To run this script, you'd simply hit return after the last digit of the c/card number. The script will say that it's 'processing...' then 'Done' when it's finished.

As I say, it works for me - hope it helps you to make sense of it all!

Best, Pete.
petermillard is offline   Reply With Quote