Archive for the ‘A Byte of Python’ Category

Interview with CocoaCast

Thursday, May 7th, 2009

I was recently interviewed by CocoaCast (mp3) to talk about Python for their Mac developer community, as part of their “Unbound Developers” podcast series.

I was apprehensive about doing this because I’ve never been live-interviewed before, but in the spirit of doing new things, I went ahead and it turned out to be fun.

We talked about Python, my background and my startup, Macs, Python vs. Ruby and Django vs. Rails, Apple and Google, cloud computing, databases, Scala/JVM, performance, collection classes, and so on.

Surprisingly, Vlad and myself had talked for nearly 25 min. It’s a fun interview, although, there’s probably nothing new to know from this podcast for those who have already read the book.

A Byte of Python in hard copy

Wednesday, October 1st, 2008

If you’re the kind of person who prefers to read a physical book vs. online books, then you’ll be happy to know that the A Byte of Python book is now available as a printed hard copy.

The best part is that the hard-working translators can also publish their translations and sell the printed copies, benefiting both the readers and the translators.

I had received many requests from readers for hard copies of the book and I’m glad to finally get this working. Interestingly, I was previously trying to get the book printed via CreateSpace because the book would automatically get listed on Amazon.com (since CreateSpace is owned by Amazon). However, their process was not streamlined and confusing. Worse, I couldn’t get the PDF in their required size formats because of a bug with mwlib.rl.

I got tired and decided to try Lulu and I was very surprised. They are miles ahead in terms of usability of their service as well as wide range of options and sensible defaults. For example, it was a pain waiting for manual approval of the book by the CreateSpace staff and it is an unnecessary delay every time I upload a new version. On the other hand, Lulu made it very easy to design a rudimentary cover using their process. Overall, I was able to make the printed copy available for purchase in a single evening.

Of course, all this is possible because of the ability to generate PDFs from a wiki, thanks to the nice people at PediaPress.

Update: For Indian readers, the book is now available via pothi.com.

Book updated for Python 3.0

Friday, September 5th, 2008

After a gap of 3.5 years, I’ve finally updated the ‘A Byte of Python’ book.

The interesting news is that it is updated for the upcoming Python 3.0 language making it probably the first book to be released for Python 3.0.

The book is now a wiki too at www.swaroopch.com/notes/Python which means you can contribute too!

The book and wiki are now under the Creative Commons Attribution-Share Alike 3.0 Unported license. The Non-Commercial clause present in the previous edition of the book has been removed. It was becoming a hurdle for translators as well as people who wanted to use the book for genuinely good activities, so I decided it to drop the clause.

Since it is a wiki, volunteers can directly create their translations on the wiki. This eliminates the need to learn DocBook XML and its tools which had become a hindrance for many translators, and I’m glad to see this already bearing fruit with Eirik Vågeskar starting off a Norwegian translation at www.swaroopch.com/notes/Python_nb-no:Forord.

I will soon be making a printed version of the book available as I have had many requests for this.

So back to the main question: Why an update after nearly 4 years? Two reasons.

First, because of foss.in. I dedicate this new release to the foss.in community for their spirit and enthusiasm over the years which have rubbed off on me and kept me working on the update of the book.

Second, Over the past few years, the readers’ reactions have been simply splendid:

Neil (bigdealneil-at-yahoo-dot-com) said:

“(I) got an if else to work and I can follow your tutorial, which I have never been able to do no matter who wrote the thing! you’re a genius Swaroop!”

Gao shuai (ejwjvh-at-126-dot-com) took the effort taken to write an email to me in English:

dear swaroop: I am a chinese student.My name is gao shuai,”gao”is my family name. Although your book is easy to understand,but my english is bad,so what I read is the chinese edition. I have made some programs now.It is interesting.I like it very much.

I emailed back and he replied:

Mr Swaroop: I am exciting to read your back. _(Editor’s note: I think he means ‘reply’)_ Tt is the first time that I talk to foreigner though the internet. I saw that you have your own mail ab.I think You’re a great man. Thanks for your back!(*^_^*) regards, gaoshuai

The interesting part is that this student somewhere in China was being benefited by this book and he “talked to a foreigner through the internet for the first time” and that person was me. It was truly humbling.

People are even putting ads for it, and I had no clue about it until I chanced upon it myself:

An ad for 'Byte of Python'!

If that wasn’t enough, I found out that there are 8-9 university courses officially using the book, including Harvard and other institutions. And apparently even NASA is using the book in their Jet Propulsion Laboratory.

Users have suggested that it should replace the official tutorial but I really wouldn’t go as far as that :)

Recently, I had sent a sneak peek for the book’s group of readers and within a day, I had the first 10$ donation by Horst JENS. I remembered seeing that name somewhere, so I searched my emails and found this:

On Mar 4, 2007:

“Hello Swaroop, i teach a class of (3) Children how to program in Python. Just want to thank you because without your ‘a byte of python’ (that i read one year ago) i would maybe never have begun to code in python and consequently would never leaved my old job to become a Python teacher.”

A person in Vienna, Austria changed his career from a sys-admin job which he didn’t like, to teaching children about programming, a job he loves. Wow! Again, this is so humbling. I could have never imagined that a small book can make such a difference.

The point is that I’m grateful for all these people writing to me and sharing their delight and stories. The book is still alive and kicking thanks to all these people.

Happy programming!

Brazilian Portuguese Bytes of Python

Wednesday, June 14th, 2006

Samuel Dias Neto has translated “A Byte of Python” to Brazilian Portuguese.

Hats off to Sam!

German Bytes of Python

Monday, March 13th, 2006

Yesterday, I got this mail from Christoph Zwerschke:

Thanks a lot for “A Byte of Python”. Since I thought it would be great if Python gets more popular in German, I participated in the German translation project at BerliOS started by Lutz Horn. Unfortunately, the translation progress stalled last year shortly before the work was finished since all of us were very busy. However, this weekend I found some time to finish the translation and cut a German release, which is now available at http://abop-german.berlios.de.

Greetings from Germany, Christoph Zwerschke

Hats off to Christoph, Lutz Horn and others who made the German version happen! Thank you guys :-)

Byte of Python is now a wiki

Wednesday, February 22nd, 2006

In a recent discussion on the byte-of-python list, an enthusiastic bunch of people were interested in seeing A Byte of Python available as a wiki so that readers can contribute directly as well.

So, I followed up and made this announcement on the list recently :

Hello all,

As we have discussed, suggestions that Byte of Python should be converted to a wiki garnered enthusiastic responses. I’ve finished converting the book to the wiki and is available at http://swaroopch.info/text/Byte_of_Python:Main_Page .

There are some Todos I’ve sprinkled across the book which I will be working on in the coming weeks. Few readers have taken the trouble in pointing out how to export a book from the wiki as well. Once I can work on the todos, I’ll work on a downloadable version.

A good advantage of the wiki is that my turn-around time to suggestions from readers have improved. For example, a user pointed out that ESR is not the one who coined the term ‘open source’ and I corrected it on the wikibook within 2 minutes.

If you want to add/remove/improve any text in the book, please feel free to register as a user on the wiki and start editing. However, if you only want to read the book, there is no need to register.

Help about how to use the MediaWiki is available at http://meta.wikimedia.org/wiki/Help:Contents .

Watching a person learn a skill

Wednesday, December 14th, 2005

I love the moment when you help somebody learn something and they have that sparkle in their eye when they realized they understood it. Here’s one of those virtual sparkles:

Oct 27, 2005:

Decided to abandon “Dive into Python” for the time being, it is REALLY frustrating for me to hanging at chapter 5 without moving forward for so long…. I think it is me, my limitation to understand. So, I decided to surf around the net to look for another tutorial, perhaps a gentler one. Foudn “byte of Python”, 110 pages in all, not too long. So, will give it a go. Hopefully within few weeks, this could equip myself better to go for “Dive into Python” again.

Nov 20, 2005:

Learning Python, still. So far so good, I am on page 85!!! So, that is only 20+ pages to finish it. I consider it a big achievement, hahaha. And, what pleased myself most is that, I finally get through object-oriented programming, hmmm, feel like celebrating already :-)

Nov 25, 2005:

Finished Byte of a Python tutorial, finally. I think the tutorial is good, especially for begineer. But I also think that it is too surface/brief if one really want to take a step further. So the tutorial itself did point out what to do next, where to go for further learning resources.

Dec 2, 2005:

I considered the basic of my contact completed. Now I have function to list out all contacts, add new contacts, delete contacts, and find a contact.

Nothing to shout about really, but the building up of this apps is quite interesting. I just create the barebone of the program to do the basic stuff, then add some validation, or extra functions, like before adding a contact, check if it already exist, if yes, ask whether the user actually want to replace the current one… etc.

Hey, I really enjoy the process. Now I am thinking of the next step, either create a better user interface with some GUI tool, or make it a web application thing. I don’t know if that is over ambitious since this is just the first actual program I wrote in Python, but we will see…

That last part about the contacts program is a task I have suggested to write a program for to test whether the reader has learnt enough about Python.

foss.in day 2

Wednesday, November 30th, 2005

Today morning, the first session was a Linux Kernel roadmap by Jonathan Corbet. Although I’ve never been a kernel-level guy, the talk was interesting and he clearly explained how features have been added and improved over the various versions, and how the development process has improved and become more “professional.”

Jonathan Corbet

Then, it was my turn to talk and I talked about TurboGears. The talk went pretty good and it was well-attended which made me quite happy even though I had some tough competition, heh.

TurboGears Talk TurboGears Talk TurboGears Talk

I did make two mistakes. First was that I got worried about the time I had to finish the talk, and second, I concentrated too much on the slides. Whenever I have presented well (which has been most of the time, thankfully), I tend to leave slides as guidance for the audience, and have my thoughts free-flowing enough to be coherent and entertaining. Well, I don’t think I’ll be making these mistakes again. However, I did get good feedback about the talk from various people, and a good number of questions after the talk, which is always a good sign. For those who couldn’t attend, my TurboGears slides are online.

And one more thing … my book’s website byteofpython.info is now running on TurboGears! This is only the second public website ever running TurboGears after diggdot.us.

Then, I attended Gopal_V’s talk on programming in the Mozilla platform. He gave a very detailed approach to creating Mozilla applications and how to go about things. I must get the slides from him later, but it shouldn’t be a problem grabbing hold of him since he works in the same floor as me at Y! His slides are online.

Gopal on programming Mozilla

I was on my way to the OpenLaszlo talk, but took a peak in the Ruby on Rails tutorial. Does Ruby on Rails really need the CREATE TABLE SQL statements to be written by hand? …. I think I prefer the SQLObject approach of having all the database-schema in one place as simple Python classes instead of having separate database creation and database manipulation (ActiveRecord) parts.. Update: The new RoR migrations feature is simply brilliant. Thanks to Mark Ramm for the tip.

Other than that, Rails looked cool. The directory structure created by rails as well as the test-driven nature was good.

Then, I got into the OpenLaszlo talk by Nirav Mehta. I had seen the OpenLaszlo demos before and used to follow Oliver Steele’s blog, but I never got around to writing anything with it. Nirav kept the audience engaged and showed off some eye candy stuff that OpenLaszlo provides from images to animation. Somebody in the audience asked him to put audio as well, but unfortunately, he didn’t have any mp3s.

Then, my friends and myself headed to the food court and then went around the FOSS Expo section. The Sun Microsystems booth was the best one and they showcased real open source projects such as Belenix (the OpenSolaris LiveCD) and NetBeans. I got a demo of OpenSolaris’ DTrace functionality and it was pretty impressive.

Food Court

Sadly, the other stalls like the Google and Yahoo! booths didn’t showcase any open source projects at all! When Google has open sourced many projects and Yahoo! has contributed open source stuff such as the Alternative PHP Cache, why can’t they show it off and demonstrate they too are part of the community (and invite people to join the company), which I thought was the point behind the stalls…

Yahoo! stall at foss.in

Then, I saw Pramode in the Phoenix stall and it seems people are showing interest in Phoenix which was good to hear. Nearby, Anush and Tejas were in the Python stall and trying to entice people to talk about Python, heh.

Soon, we were back in the Intel hall for Jaya Kumar’s talk on GPL and non-GPL code interaction in the Linux kernel. He stressed that binary-only kernel driver modules are not a good idea and his explanation was pretty simple – it screws users on other architectures and users using different distro-compiler-etc. combinations. Another point is that they are not respecting the people who wrote the Linux kernel. He quoted Linus Torvalds saying it has to be a two-way street, if somebody wants to write something using the Linux kernel, they have to contribute back as well. Jaya Kumar was over-shooting his time slot but he had a lot of interesting examples and incidents to talk about. I think he had more than 100 (sic) slides in his presentation. Outside the hall, Jaya Kumar and Harald Welte were mobbed and they had a good time interacting with others.

Jaya Kumar and Harald Welte Jaya Kumar and Harald Welte

Then, I attended the “FOSS in Education” BoF. Philip, Manish and Praveen were also there. The discussion involved quite a number of issues and Praveen has added a nice page in the FCI wiki regarding the discussion. The focus was mainly in creating awareness, and getting students interested, at the high school level. The emphasis shouldn’t be in simply using open source but stressing the points on why open source is good for everybody, and how the community is the core strength.

FOSS in Education BoF

Phew. As you can gather, it was a long day but an exciting, educative and interesting one.

I was looking at planet.foss.in and hoping to look for any insights from the many talks that I missed today (there are 6 tracks running in parallel!), but it seems very few people write such long posts as dumb me!

Thout Bytes

Tuesday, March 22nd, 2005

OSoft, Inc. have released my book ‘A Byte of Python’ in Thout format. There are two aspects of Thout – one is that the Thout format is based on XHTML and second, the Thout reader software (similar to Windows .chm Help Viewer) is available for all the major platforms. I am excited about this because Thout provides some very cool functionality – for example, users will soon be able to "upload/download public notes that are placed at the point in the documentation the comment refers to".

There are currently three Python books in Thout format at the OSoft website – the official Python documentation, my book and ‘Dive Into Python’. There are lots of books in the other categories as well.

Btw, Thout software is OSI-certified open source, so it’s good to know that the Thout format itself is implicitly open as well.

Coming soon : Learn Python in German!

Saturday, February 19th, 2005

Lutz Horn, Bernd Hengelein and Christoph Zwerschke have volunteered and started to translate my Python beginner’s book to German! The project is hosted at developer.berlios.de/projects/abop-german.

If you know Python and German, you’re most certainly welcome to join the translation as well. You can start just one page at a time! Please contact Lutz Horn (lutzhorn at users.berlios.de) or myself (swaroop at byteofpython.info) for more details.

Thanks to Lutz, Bernd and Christoph for taking up this effort! :)