View Full Version : using python with windows xp


tuufbiz1
05-05-2009, 02:06 PM
I have activestate python 2.6 installed on my winxp computer. I've successfully obtained a PID using kindlepid.py but am unable to use the mobidedrm.py script since I keep getting the following error message: No such file or directory: 'python'. I enter the info as following: python mobidedrm.py Name-of-book.format Name-of-book.format PID and it doesn't work. How does this program know where to find the ebook file? Is that the problem? I've tried cutting and pasting the ebook file everywhere .... even in the folder where the mobidedrm.py script is located.... but no luck. What am I doing wrong?

AnemicOak
05-05-2009, 03:07 PM
Try putting the book in the same folder as the script and not putting 'python' at the beginning of your command string just mobidedrm drmdbook.prc undrmdbook.prc PID (.prc could also be .mobi or .azw). Also make sure you're in the folder where the script is before starting (for example C:\mobi>).



Mods, if this is TMI feel free to delete or edit.



`

tuufbiz1
05-05-2009, 03:22 PM
Try putting the book in the same folder as the script and not putting 'python' at the beginning of your command string just mobidedrm drmdbook.prc undrmdbook.prc PID (.prc could also be .mobi or .azw). Also make sure you're in the folder where the script is before starting (for example C:\mobi>).



Mods, if this is TMI feel free to delete or edit.



`

I put the ebook file in the same folder as the script file and I omitted the word python in the argument. Now I get a different error message: invalid PID checksum. FYI - when I run kindlepid.py and omit "python" as the first word in the argument --- I get a different PID value??? I also tried using this PID for the mobidedrm.py (also omitting python --- no luck)

AnemicOak
05-05-2009, 03:42 PM
The 'invalid PID checksum' has come up in other threads

Maybe you can find the solution here...
http://www.mobileread.com/forums/showthread.php?t=26093

Otherwise searching for invalid PID checksum brings up a few other threads too.

JSWolf
05-05-2009, 05:56 PM
Try uninstalling Active State Python and get Python at http://www.python.org.It is what most people use.

BinaryTB
05-05-2009, 05:56 PM
If everything else fails, try the Python from python.org (what most people use), not ActiveState.

Leep
05-05-2009, 06:19 PM
Most likely your problem is either your command line or you have not gotten a valid PID. When you run KindlePID, make sure that all the alphas are input as capital letters, leave out any spaces and 0 are numerics (zero).

Then put your python script in the same folder as your ebook. Open a command prompt window and change directory to that folder. i.e. cd desktop\ebooks When you see confirmation that you are in the correct folder, your input line should be mobidedrm.py ebookname.azw newebookname.prc PID If the ebook name or new ebook name have any spaces in it, enclose the name in " " i.e mobidedrm.py "ebook name.azw" "new ebook name.prc" PID.

Let us know if you still have problems. I am using activestate Python for all my python scripts with no issues.

cheers
Lee

wallcraft
05-05-2009, 06:44 PM
Leep's post should be enough to get you going. If not, try argecho.py (http://www.mobileread.com/forums/showpost.php?p=228313&postcount=27) and pid_checksum.py (http://www.mobileread.com/forums/showpost.php?p=317502&postcount=233). Note that if pid_checksum reports a bad PID, it has most likely been typed in wrong (e.g. 0 or O or 1 for I).

tuufbiz1
05-06-2009, 12:27 AM
Most likely your problem is either your command line or you have not gotten a valid PID. When you run KindlePID, make sure that all the alphas are input as capital letters, leave out any spaces and 0 are numerics (zero).

Then put your python script in the same folder as your ebook. Open a command prompt window and change directory to that folder. i.e. cd desktop\ebooks When you see confirmation that you are in the correct folder, your input line should be mobidedrm.py ebookname.azw newebookname.prc PID If the ebook name or new ebook name have any spaces in it, enclose the name in " " i.e mobidedrm.py "ebook name.azw" "new ebook name.prc" PID.

Let us know if you still have problems. I am using activestate Python for all my python scripts with no issues.

cheers
Lee

Thank you very much for your help but it still doesn't work. I placed the ebook in same folder as the mobidedrm.py folder and I changed the directory to this folder. Again, the kindlepid.py ran fine (although it gave me a different value than when I ran it within the active python interface). When I run the mobidedrm.py ebook.azw ebook.mobi PID I get the following message: [Errno 2] No such file or directory: 'ebook.azw'

tuufbiz1
05-06-2009, 12:42 AM
Thank you very much for your help but it still doesn't work. I placed the ebook in same folder as the mobidedrm.py folder and I changed the directory to this folder. Again, the kindlepid.py ran fine (although it gave me a different value than when I ran it within the active python interface). When I run the mobidedrm.py ebook.azw ebook.mobi PID I get the following message: [Errno 2] No such file or directory: 'ebook.azw'


I just tried to redownload the mobidedrm.zip file and extract the files again.
When I run the kindlepid.py I get the same result but when I run mobidedrm.py I get a new error message: error: invalid encryption type: 0

tuufbiz1
05-06-2009, 12:53 AM
I just tried to redownload the mobidedrm.zip file and extract the files again.
When I run the kindlepid.py I get the same result but when I run mobidedrm.py I get a new error message: error: invalid encryption type: 0


IT WORKS!!!!!!!!!! THANK YOU SO MUCH!!!!!!!
I redownloaded the mobidedrm.zip file and extracted the files and ran everything through the command prompt and it works! I got a different PID when I ran it from with activestate python.