
> python
Python 2.5.1 (r251:54863, Jan 10 2008, 17:45:16)
[GCC 4.2.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
Related Posts
Tags: python
Posted in programming on February 19th, 2008 |
No Comments »
Here is a list of the most popular programming languages, in order of popularity. One column shows the popularity as of January 2008, and another shows the popularity in January 2007 for comparison. Python moved up, Perl is dying. I was surprised that some languages are as popular as the index shows.
According to the site:
The index can be used to check whether your programming skills are still up to date or to make a strategic decision about what programming language should be adopted when starting to build a new software system.
Related Posts
Tags: language • perl • programming • python
Posted in programming on January 21st, 2008 |
No Comments »
I’m constantly finding myself in need of small, quick, personal database programs. Something light and flexible. Quick to mock up, quick to write, easy to use, painless to dump. And I find myself wanting and writing the same kinds of applications again and again.
Sometimes a text file just isn’t enough. And writing redundant SQL queries can get tiresome. Perhaps I need to print nicely-formatted reports. Perhaps I need some web connectivity for retrieving remote information. Or, what if I want to give this program to someone else to run? How many people know how to do database administration? The data needs to be conveniently stored in one place for the easiest possible backups.
What I really need is a framework. A cross-platform framework that will allow me to create these types of applications in a heartbeat. I should even be looking forward to the two minutes it would take to copy a template project and build a whole new application and have it up and running in minutes. Any changes I want to make to the data model should be immediately reflected everywhere with no extra work. But if I want something powerful, I want the framework to be flexible enough to let me get in and make it so.
Interested? Here’s my solution… » Read the rest of this entry
Related Posts
Tags: cheetah • cherrypy • css • fltk • git • javascript • mysql • openoffice • python • resizable • sqlite • textarea • windows
Posted in programming on December 11th, 2007 |
No Comments »
The autofs solution for the iPod Shuffle that I discussed last month has been working out great. But what about a command-line approach to managing your music on the iPod Shuffle? You can use the iPod shuffle Database Builder.
» Read the rest of this entry
Related Posts
Tags: autofs • ipod shuffle • linux • python • rebuild_db
Posted in solutions on December 4th, 2007 |
No Comments »
I’ve been working on a web project that uses a python stack. It uses cherrypy for the web server, cheetah for the templates, and sqlite for the database engine. I wanted to get Unicode working throughout the application. The application should be able to transfer Unicode data to and from the database, have Unicode text in the script files themselves, and be able to display Unicode text, with UTF-8 encoding throughout. It took a bit to gather all the pieces together, but it’s finally working and here’s how.
» Read the rest of this entry
Related Posts
Tags: cheetah • cherrypy • python • sqlite • unicode • utf8
Posted in programming on November 16th, 2007 |
2 Comments »
Lately I’ve been noticing a void in my life that I want to see filled. I am speaking, of course, about my need for a personal wiki. Why, you ask?
» Read the rest of this entry
Related Posts
Tags: c • life • meditation • python • wiki
Posted in programming on November 12th, 2007 |
No Comments »
This tutorial, Code Like a Pythonista: Idiomatic Python is just tremendous. I learned some new stuff here and there, and the guidelines for module formatting I found very practical. Good stuff.
Plus, there is a great quote by Brian Kernighan:
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Related Posts
Tags: python • quotes • tutorial
Posted in programming on November 6th, 2007 |
No Comments »
How do you connect to a Microsoft SQL Server instance from Python on Arch Linux? You’re going to need FreeTDS, and pymssql. Here’s how to do it.
» Read the rest of this entry
Related Posts
Tags: freetds • linux • pymssql • python • sql server
Posted in linux, programming, solutions on August 21st, 2007 |
1 Comment »