0 to 60 with Django in 5 steps

Django is great, but its tutorial is not: instead of focusing on a website that can control a Python application (which is what most of us care about), it discusses templates for admin pages and presenting 404 errors.  So let’s walk through making a Django app that can call a Python function, by doing the…

10 Things I Wish Every Python Script Did

Python scripts aren’t supposed to be works of art, but it’s rare to find one that’s instantly usable. Here are 10 things I wish all scripts would do: 10. Set correct permissions A script that doesn’t have proper execution permissions makes me very angry. Set chmod a+x so anybody can run the script (unless it…

9 Reasons to Switch from MATLAB to Python

I’ve previously complained about MATLAB, but continued to use it because I didn’t have a better tool. After seeing so many engineers and scientists agree that Python is a superior tool compared to MATLAB, I finally decided to make the switch. In retrospect, it’s one of the best tool decisions I’ve ever made. Here are…

How to easily import your own Python packages

Python is my favorite language by far, but here’s one thing it’s absolutely terrible at: package management. Some decent tools (easy_install, pip) exist, but what if you’ve created your own module or package?  Ideally, you could start Python from anywhere and simply run: >>> import mypackage If you’re running Python from the same directory where…

5 Reasons I Hate MATLAB

I’ve used MATLAB almost ever single day for the last year, and I can say confidently that two things are true of MATLAB: Every engineer has used it. No engineer likes using it. Certainly, there are lots of great things about MATLAB – and MathWorks would be glad to tell you what they are.  So…