Code and comments

Practical and theoretical aspects of software development

Posts Tagged ‘python

Book Review: Core Python Programming by Wesley Chun

leave a comment »

CPP

f you are want to learn Python, and you like to learn from books, there is a clear consensus: Dive into Python. It’s available free online, so I gave it a try.

I didn’t like it. I felt bad for not liking it, after all, everyone agrees it’s a great book. Mark Pilgrim takes an interesting approach, diving in with real-world examples of what can be done with Python, rather than the typical approach of introducing the language systematically. But it just didn’t work for me. I found myself unmotivated by the examples, and bothered by the fundamental questions that hadn’t been answered. I had to look elsewhere.

Finding a reliable suggestion for an introductory Python text that isn’t Dive into Python isn’t easy, but John Cook recommended Core Python Programming(CPP) by Wesley Chun. I’ve agreed with John enough times that when it was time to actually learn Python, I bought Chun’s book. Read the rest of this entry »

Written by Eric Wilson

September 26, 2011 at 5:38 am

Posted in reviews

Tagged with ,

The first thing you should know about matrices.

leave a comment »

When you look at NumPy, Python’s numerical library, the first object you will encounter is the ndarray, or n-dimensional array. Also known as a matrix, right? Wait, there is also a matrix class in the linalg submodule, that can’t be right. And worse, matrix is not nearly as general as ndarray, it only allows two dimensions. Is that really good enough for real-world data?

Based on experience in higher education, I’m confident that over 90% of those that have seen matrices missed the point. If you don’t know why a matrix must have exactly two dimensions, than you don’t know what a matrix really is. (So read on.)

Read the rest of this entry »

Written by Eric Wilson

September 15, 2011 at 9:52 pm

Posted in didactics

Tagged with , , ,

Python 3 Library updates, via twitter

with 5 comments

I’ve launched a new twitter account, @Py3K_update, which will send out tweets to notify followers when Python packages support Python 3. If this sounds like information that you want, please follow and/or tweet about this account.

If you are curious about the details, read on.

Read the rest of this entry »

Written by Eric Wilson

September 6, 2011 at 11:00 am

Posted in projects

Tagged with , , , ,

Tweeting in Python – the easy way

with 4 comments

Suppose you want to send tweets from Python code from your own Twitter account. How hard could that be? It’s Python, so the batteries are included right?

It turns out that the Python side is pretty slick, but there are some issues about interacting with Twitter that aren’t as easy as you could imagine.

Do I need to use a library?

The mature Python Twitter libraries, (Python Twitter Tools, and Python Twitter) will allow you to do anything that you could want with the Twitter API. But you’re just trying to send tweets, you don’t need to look at your friends’ timelines’. Maybe this approach is more what you are looking for?

Well not exactly like that. That approach uses Basic Authentication, which is no longer supported. Whatever you do will require OAuth, so it’s definitely going to take less time to use a library for novice twitter devs.

The absolute easiest way

Read the rest of this entry »

Written by Eric Wilson

August 22, 2011 at 4:00 pm

Posted in how-to

Tagged with , , ,

Follow

Get every new post delivered to your Inbox.

Join 165 other followers