Python


If you’re like me, you missed PyCon North America 2014 this year. It happened last weekend. While the main conference days are over, the code sprints are still running. Anyway, for those of you who missed PyCon, they have released a bunch of videos on pyvideo! Every year, they seem to get the videos out faster than the last. I think that’s pretty awesome myself. I’m looking forward to watching a few of these so I can see what I missed.

PyCon US / Canada (North America?) is starting this week and in honor of my favorite conference, I am having a pre-order sale for my book, Python 101. From now through April 17th, you can get $7 off (almost 50%) of Python 101. Just enter the following code at checkout: pycon2014

I just wanted to drop a quick note that the Python 101 book is now available for Pre-order here. Currently you will receive the draft versions of the book as they become available. Right now, Parts I and II have been released which amounts to approx. 115 pages of content.

mousecovertitlejpg_sm2

You can read more about the book below: (more…)

When you’re first starting out as a Python programmer, you don’t think about how you might need to install an external package or module. But when that need appears, you’ll want to know how to in a hurry! Python packages can be found all over the internet. Most of the popular ones can be found on the Python Package Index (PyPI). You will also find a lot of Python packages on github, bitbucket, and Google code. In this article, we will be covering the following methods of installing Python packages:

  • Install from source
  • easy_install
  • pip
  • Other ways to install packages

(more…)

The lxml.objectify sub-package is extremely handy for parsing and creating XML. In this article, we will show how to create XML using the lxml package. We’ll start with some simple XML and then try to replicate it. Let’s get started! (more…)

There are a couple of ways to create Microsoft Excel spreadsheets with Python. You can use PyWin32′s win32com.client method, which was discussed in an old article a number of years ago or you could use the xlwt package. We’ll be looking at the latter in this article. You will learn how to create an Excel spreadsheet with multiple worksheets and how to create styled cells. Let’s get started! (more…)

The Python 101 book campaign finished today. I am now well funded to create the book and get all the artwork done. I think I may try to get additional illustrations too. While we didn’t hit the next stretch goal, I plan to go ahead and work on screencasts anyway. As I mentioned previously, I most likely won’t start on those until after I’ve finished writing the book. I have received lots of positive comments about the book so far and I hope to put out a product that you will find useful.

I will be sending out Part I as soon as I can after Kickstarter transfers the funds. You will receive a survey asking for your email address. I will probably be sending a survey out to those who bought t-shirts and such too.

Thanks a lot for all your support. I am very grateful.

Code profiling is an attempt to find bottlenecks in your code. Profiling is supposed to find what parts of your code take the longest. Once you know that, then you can look at those pieces of your code and try to find ways to optimize it. Python comes with three profilers built in: cProfile, profile and hotshot. According to the Python documentation, hotshot “no longer maintained and may be dropped in a future version of Python”. The profile module is a pure Python module, but adds a lot of overhead to profiled programs. Thus we will be focusing on cProfile, which has an interface that mimics the profile module. (more…)

Python comes with its own debugger module that is named pdb. This module provides an interactive source code debugger for your Python programs. You can set breakpoints, step through your code, inspect stack frames and more. We will look at the following aspects of the module:

  • How to start the debugger
  • Stepping through your code
  • Setting breakpoints

Let’s start by creating a quick piece of code to attempt debugging with. (more…)

There are under 2 days left in the book campaign! I think that’s pretty exciting. I hope you do too!

I’ve been busy writing the new Part 3 lately. I only have two more chapters to go before it’s done. My hope is that Part 3 will be done by the end of the week.

I have also come up with a fun little script that can put my book together for me. Today it dawned on me that this little program would be a good illustration for my readers about how to tackle a project and break it into more manageable pieces. So I’ll be adding a chapter or two somewhere in the book about that as some of my backers have already mentioned that they would like to know how to do this sort of thing.

Thanks for your support!

Next Page »