Archive for the ‘Python’ Category
DefectiveByDesign and other Free Speech advocacy groups have been targeting the Kindle for its DRM limited content. This was something I grappled with when I bought my Kindle last year. Of course Amazon wants Kindle users to buy books from their store, but limiting ebook content really limits the usefulness of the Kindle! What if an ebook I want isn’t available through Amazon, but is available in another format through another seller? What about checking out ebooks from the library?
I initially was interested in ebook readers because I use the bus as my main mode of transportation. Also I love to read but I tend to forget to return books to the library and my collection of used books keeps growing. Living in the city, I don’t have a lot of space. If I could have all of my (non-picture) books as ebooks I would be very satisfied.
The great thing about the Kindle is that I’ve been reading A LOT more and it’s a fun device to use.
The not-so-great thing is that Amazon limits the way you can access ebooks DRM’ed by other providers. Fortunately there are ways around these limitations!
Download Free Ebooks in Mobi Format
There are non-DRM books available that the Kindle can read and it’s really easy to do. I use my SD card because I think cables are annoying. Insert the SD card into your computer and create a new folder called “documents”.
There are several free ebook sites on the web, in particular Project Gutenburg and Mobipocket Free Books. Pick a title and download it in “mobi” format. Save it to the “documents” folder you created on your SD card.
Insert the SD card into the Kindle. When you start your Kindle up, you will see the titles you downloaded as “new” items.
Convert Digital Files to Mobi Format
Kindle offers a service that will convert other ebook formats (HTML, PDF, etc) to Mobi format. This service is $.10 USD per book. Alternatively you can convert it yourself. Either use MobiPocket Reader to import the file (it is saved under “My eBooks” in your Documents folder) or download MobiPocket Creator. Note that there may be additional challenges with DRM’ed ebooks. Once converted, copy the files into the “documents” folder either on your Kindle or on your SD card.
Register Your Kindle as a MobiPocket Reader Device
The final workaround involves registering your Kindle as a MobiPocket Reader device. Not only can you read Kindle ebooks on your computer, but you can transfer them to other devices, and even transfer ebooks DRM’ed by other providers to your Kindle. For more detailed instructions on converting the Kindle files to MobiPocket format, see this article.
Step 1) Get the Serial Number of your Kindle.
This is under the back cover on the label above the battery. The “Serial No.” is listed under the first barcode.
Step 2) Copy the ebook file from the Kindle to your computer.
Insert the SD card into your Kindle. Open the Content Manager and select a book on your list. Choose the option to save it to the SD card. Alternatively you can download files from your Kindle profile in Amazon to your computer.
Turn off the Kindle and insert the SD card into your computer. Your book is in a folder called “downloads”. I have a folder I created in “Documents” called “Ebooks”.
Step 3) Install Python and download the scripts.
Install Python 2.6 if you haven’t already. Note that the scripts are not compatible with Python 3.x. On Windows, I recommend ActivePython. Next download a small suite of Python scripts from the linked article above, under “Step 4”. Please let me know if the archive is unavailable so I can update this article.
When you extract the archive, you can place the scripts in the Tools\scripts directory of your Python folder and update the system path variable. I placed mine in the same folder I save my ebook files to for convenience. You need to run the scripts from the same location as the files you copied from your Kindle.
Step 4) Create the Mobi file
Open up a command line interface. On Windows type “cmd” either in “Run” (XP) or in the search dialogue of the Windows menu (Vista).
Navigate to the folder containing the files you copied from your Kindle:
Type the following command, replacing yourserialnumber with your serial number:
python kindlepid.py yourserialnumber
The script returns a 10-digit PID as the last item on the printed line. The third to last digit of the PID is an asterisk(*). Make a note of the PID.
Step 5) Open the book in Mobipocket Reader.
Install Mobipocket Reader if you haven’t already done so.
To register your Kindle as a device in Mobipocket Reader, select Reading Devices from the navigation on the left. Click the button located at the upper center part of the window to add your Kindle. I named my Kindle “Kindle” and chose “Other” for device type. Enter your PID in the field that asks for a MobiPocket ID. To open Kindle files in Mobi, change the extension of the “.azw” file to “.mobi”. Select Open or Import to view the file in Mobipocket Reader.
Double click the .mobi file you created to open it in Mobipocket Reader. Use Mobipocket Reader to register other supported devices so you can transfer your ebooks to them!
I’m currently curious about game programming (and artwork). While I know C++ I am also interested in exploring viable Python alternatives. Python is an easy to use language that would enable rapid prototyping, and I think it’s easier to read and maintain in the long run.
The options for Python game development I found are as follows: <a href=http://www.pygame.org>pygame</a>, <a href=http://www.crystalspace3d.org/main/CELstart>CrystalSpace3d CELstart</a>, and <a href=http://www.ogre3d.org/wiki/index.php/PyOgre>PyOgre</a>.
Pygame is mainly targeted at 2D animation which is ideal for simpler games or just starting out.
PyOgre’s instructions indicate it will take 3-4 hours possibly over several days to compile and install on Linux (but they have a self extracting exe for windows developers).
CrystalSpace3d CELstart can be downloaded (and updated) via apt for Debian users and has support for Blender via Blender2crystal (also available via apt).
The easiest one to get started with is definitely CrystalSpace3d. Do not, I repeat, do not install ANYTHING before following the HOWTO. If you already have CrystalSpace3d installed you might want to uninstall it then reinstall everything through the Blender2crystal-sdk. I had a dependency problem and that’s how I resolved it.
There is a great HOWTO here for Debian packages:
You can download some CEL examples from the CrystalSpace 3d site. To run the examples, type “celstart xxx.celzip” from the directory where you downloaded the zip file. Press ESC to exit.
Blender is a little quirky… no window frames or borders, and it’s full screen right away. fun.. 😛 To make it usable I turned on auto-hide for the top and bottom toolbar space area.
My research for game development in Python on Linux has only just begun, but at least I’ve got the tools configured (I hope..).