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…

If You Love Nostalgia, You’ll Love Retro-Proteins

I’m not sure how real this is, but the possibility is mind-bending: New Scientist reported yesterday that an ancient super-powerful antibiotic was reverse-engineered from current-day proteins.   GenomeWeb states the achievement quite succinctly:  The researchers then worked backwards to find the genetic sequence of the original peptide — active 59 million years ago — and…

Genomics is the beginning of the Second Age of Science

When you think about it, humans have always known more about the cosmos than about themselves.  The earliest ‘wise men’ were astrologers, observing the orbits of the stars and theorizing about the composition of the universe.  The oldest and most renowned scientific institutions (Copenhagen, Hamburg, even Oxford’s science department) were founded by physicists.  The most…