Nick Carroll

Metabolising caffeine into code

Archive for the ‘python’ tag

Paver for building and deploying Python applications

without comments

I stumbled across Paver, a build and deploy tool for Python applications. It will be presented at the upcoming Pycon. Looks the goods to me.

Written by Nick

February 23rd, 2009 at 8:44 pm

Posted in Programming

Tagged with

Old School Editors for Python Development

without comments

Here are a couple of good resources for configuring Vim and Emacs for Python development. I know more key-bindings with Emacs than Vim, so my preference is for Emacs, but I am certainly intrigued about trying Vim again after reading how to set it up for Python coding.

Written by Nick

May 12th, 2008 at 9:47 pm

Posted in Programming

Tagged with , , ,

Python Decorators

with one comment

I found this great post on Python Decorators. Decorators were introduced into the python language since 2.4. The post shows the benefits of using a python decorator to improve the efficiency of a function’s runtime using memoization.

Python decorators are also extensively used in Django for authentication. For example, you can use them to decorate a view function so that only logged in users can view certain parts of your site.

from django.contrib.auth.decorators import login_required

@login_required
def my_view(request):
    # ...

The example code above shows that you only need to add the @login_required decorator above your view function to determine whether or not the current user needs to be authenticated before the view can be displayed.

Written by Nick

April 20th, 2008 at 8:26 pm

Posted in Programming

Tagged with

Benevolent Dictator for Life

with 4 comments

I’m glad that I started playing around with Django a couple months ago. It has forced me to learn Python. I now feel more at home with Python than I ever did with Ruby. Learning Python has been especially useful with exploring Gnome’s API (as I run Ubuntu on my laptop). There are also some good editors for Python, but I quite like Gedit, and I have been messing around with writing a simple plugin that uses Exuberant CTags for navigating Python code. The Gedit plugins can easily be written in, you guessed it, Python.

App Engine

There is a lot happening in the Python world, and the biggest news of late is Google’s Beta access to their new service App Engine. It is basically a service for hosting your Python applications. It currently supports any Python application that uses CGI. Essentially you can get a Django web application running on App Engine, but a bit of work will be needed to integrate with App Engine’s datastore.

Anyway I don’t want to ignite a flame war as I am a lone Pythonista in a company full of Rubyists.

Written by Nick

April 8th, 2008 at 9:17 pm

Posted in Programming

Tagged with , ,