Education


My first book, Python 101 has been published today. You can buy it directly from my blog which will get you a PDF, EPUB and MOBI version of the book. You can also purchase a softcover edition of the book via Lulu. Finally, I have published the eBook to Amazon.

If you happen to run a Python or technology blog and would be interested in reviewing my book, Python 101, please feel free to contact me with your blog’s information. I am looking for a few good bloggers to review the book.

mousecovertitlejpg_sm2

Order Now

Here’s some more information about the book:

Part One

The first part is the beginner section. In it you will learn all the basics of Python. From Python types (strings, lists, dictionaries) to conditional statements to loops. You will also learn about comprehensions, functions and classes and everything in between! Note: This section has been completed and is in the editing phase.

Part Two

This section will be a curated tour of the Python Standard Library. The intent isn’t to cover everything in it, but instead it is to show the reader that you can do a lot with Python right out of the box. We’ll be covering the modules I find the most useful in day-to-day programming tasks, such as os, sys, logging, threads, and more.

Part Three

This section covers mostly intermediate level material. Here are the topics covered:

  • lambda
  • decorators
  • properties
  • debugging
  • testing
  • profiling

Part Four

Now things get really interesting! In part three, we will be learning how to install 3rd party libraries (i.e. packages) from the Python Package Index and other locations. We will cover easy_install and pip. This section will also be a series of tutorials where you will learn how to use the packages you download. For example, you will learn how to download a file, parse XML, use an Object Relational Mapper to work with a database, etc.

Part Five

The last section of the book will cover how to share your code with your friends and the world! You will learn how to package it up and share it on the Python Package Index (i.e. how to create an egg or wheel). You will also learn how to create executables using py2exe, bb_freeze, cx_freeze and PyInstaller. Finally you will learn how to create an installer using Inno Setup.

Writing Style

This book will be written using my original blogging style. This means that the chapters will be shorter than your usual programming textbook. Most chapters will most likely be less than 10 pages! The idea here is to get the reader up to speed on the subject, not to beat them over the head with it.
Who should read this book?

This book is for beginners, but I believe people with intermediate skills will also find its contents valuable.

Packt Publishing asked me to be a technical reviewer for one of their latest Python books, Mastering Object-Oriented Python by Steven Lott. This book is a sequel of sorts to their 2010 release, Python 3 Object Oriented Programming by Dusty Phillips, which I reviewed here.

Note: This book is explicitly for Python 3 developers and does NOT talk about Python 2 much at all.


Quick Review

  • Why I picked it up: I was asked by the publisher to be a part of editing the book, however this is just the sort of book I like to read
  • Why I finished it: It’s quite well written and you learn a lot about how the internals of classes work
  • I’d give it to: An intermediate Python programmer who wants to learn new things

(more…)

Python decorators are really cool, but they can be a little hard to understand at first. A decorator in Python is a function that accepts another function as an argument. The decorator will usually modify or enhance the function it accepted and return the modified function. This means that when you call a decorated function, you will get a function that may be a little different that may have additional features compared with the base definition. But let’s back up a bit. We should probably review the basic building block of a decorator, namely, the function. (more…)

Python has a vast library of modules that are included with its distribution. The csv module gives the Python programmer the ability to parse CSV (Comma Separated Values) files. A CSV file is a human readable text file where each line has a number of fields, separated by commas or some other delimiter. You can think of each line as a row and each field as a column. The CSV format has no standard, but they are similar enough that the csv module will be able to read the vast majority of CSV files. You can also write CSV files using the csv module. (more…)

I’m sure some of you have been wondering if I had a more concrete outline of the book that I am currently writing. As a matter of fact, I do. Here’s what I have so far:

Part One: Learning the Basics

  • Chapter 1 – IDLE
  • Chapter 2 – Strings
  • Chapter 3 – Lists, Tuples and Dictionaries
  • Chapter 4 – if/elif/else statements
  • Chapter 5 – Loops
  • Chapter 6 – Comprehensions
  • Chapter 7 – Exception handling
  • Chapter 8 – Working with Files
  • Chapter 9 – Importing
  • Chapter 10 – Functions
  • Chapter 11 – Classes

Note: Part One is written and in the editing phase

(more…)

Editor’s note: This is a guest post from Yasoob Khalid who authors the Free Python Tips blog

So hi there guys! I hope you are fine. So what is in this post? Today we will be writing a cleanup script. The idea for this post came from Mike Driscoll who recently wrote a very useful post about writing a cleanup script in python. So how is my post different from his post? (more…)

The Real Python: Advanced Web Development, featuring Django 1.6 KickStarter campaign released a preview chapter today called “Software Craftmanship”. It is the first chapter from the book. The PDF download consists of 33 pages.

You can go get it too by going to the following address: http://www.realpython.com/preview/. If you haven’t already, you can still support their Kickstarter for 3 more days.

I recently received a copy of Kivy: Interactive Applications in Python by Roberto Ulloa. This is currently the only book about Kivy. Kivy is a cross-platform GUI toolkit that will run on Linux, Windows, and OS X as well as Android and iOS. In fact, the people behind Kivy emphasize that this is aimed primarily at mobile programming. Kivy supports multitouch and has a very active group of programmers. You can read more about Kivy on their project’s home page. I will be reviewing the PDF version of the book.

Here’s my quick review for those of you without a lot of time:

Quick Review

  • Why I picked it up: I received this book as payment for helping with the reviewing of another Packt book, but I would have bought it myself because I am interested in learning Python for Android/iOS and I like learning about Python GUI toolkits.
  • Why I finished it: The book is short and I was optimistic that it would get better.
  • I’d give it to: Someone who already knows Python and the basics of Kivy, although I don’t think I would recommend it.

(more…)

python_machine_learning

Earlier this year, Packt Publishing asked me to be a technical reviewer of one of their upcoming books, “Building Machine Learning Systems with Python” by Willi Richert and Luis Pedro Coelho. Now the book is available for purchase and they have asked me to write a little about it. I haven’t read through the finished product myself, so I don’t know if the authors followed any of my advice, but I should note that English appeared to be their second language, so the book will likely be a little rough.

However, the content is interesting and I thought it was fairly comprehensive. They appeared to know what they were talking about. A lot of this book is over my head as I am not a scientist or engineer in the topic that this book covers. Basically, this book is about data mining using scikit-learn, mahotas and jug. You will learn about such heady topics as computer vision, basket analysis, how to classify data, etc.

You can check the book out on Packt’s website or on Amazon.

UPDATE (2013-08-22) – One of the authors commented on this post to let me know that they’ve cleaned up the text.

My wife teaches 3rd grade math and she recently learned about the process of obtaining the digital root of numbers. The digital root is a single digit number found by summing the individual digits. So for 15, you would add 1+5 to get 6. Thus 6 is the digital root of 15. The trainer that my wife worked with explained that you can check your answers using the digital root, which will give children another way to find out if their answer is correct. Here is an example:

15   1 + 5 = 6
+12   1 + 2 = 3
      6 + 3 = 9
----
 27   2 + 7 = 9

So here we have two operands: 15 and 12. If you add those together, you get 27. To check your answer using the digital root, you add the individual digits in the two operands as above. So 15 becomes 1+5 or 6 and 12 becomes 1+2 or 3. Then you add those two roots together to get 9. Then you check your answer by adding up its digits, which in this case is 2+7 which equals 9. The rules are slightly different for subtraction, multiplication and division. We’ll be looking at addition, subtraction and multiplication. We are skipping division because I haven’t found a good explanation for how it works and I don’t want to just use formulas that I can’t explain.

At this point you’re probably wonder where Python comes in. We’ll use wxPython to create a simple GUI that will allow us to see how this works. Let’s start coding! (more…)

Next Page »