Tagpython

Moscow Django Meetup

I’m not a huge fan of Django¬†although Python is one of my favorite languages. Last week I heard about a Django Meetup happening in Moscow, so I decided to give it a go. It was fun, there were three speakers and around forty attendees, in a really nice venue. The three topics were PyCharm IDE, Continuous Integration and a different (and rather strange) approach at handling HTTP requests in...

Encode Entities Inside PRE Tags

Here’s a little Python script that searches through a given file for pre tags and encodes anything in between. This is useful for when escaping from syntax highlighting plugins and replacing every occurrence of the code shortcode with a pre tag. import re, sys # First argument is the filename, output is filename.encoded filename = sys.argv[1] f = file(filename) output = open('%s.encoded' %...

Happy 2011: In 10+ Different Programming Languages

The end of the year 2010 is near so I’ve prepared this post for all you coders, developers and other geeks. You know when you build applications (especially web applications) you often leave a copyright notice on every page saying “Copyright 2010, All Rights Reserved” or whatever? Right, but what developers tend to forget is that time passes by and that they have to go back and...

Pickle vs JSON — Which is Faster?

If you’re here for the short answer — JSON is 25 times faster in reading (loads) and 15 times faster in writing (dumps). I’ve been thinking about this since I wrote the ObjectProperty and JsonProperty classes for Google App Engine. They’re both easy to use and work as expected. I did have some trouble with ObjectProperty but I figured it out in the end. As my previous...

App Engine: JSON Objects in the Google Datastore

Following up on my previous post about Python Objects in the Google Datastore where I’ve shown an easy way of storing any python object inside the Google Datastore by pickling it. Pickling works fine and it can literally store functions, classes and class instances in the datastore which is great, but as I discussed earlier, JSON could work too, so here I’ll introduce a similar...

App Engine: Python Objects in the Google Datastore

Howdy! Hope you’re all good and getting ready for the upcoming holidays! I’ve been writing Google App Engine code last month more than ever before. I finally got to a file and data structure that I myself can understand. Hopefully we’re all aware that the Google Datastore is not relational and that most of the frequently used data types are supported: StringProperty...

Installing Python 2.5 on Ubuntu Linux 10.10

If you’ve been working on App Engine and you’ve noticed that some stuff works on your development server but not on your production, it may be related to the different versions of Python. Latest linux builds including Ubuntu 10.04 and 10.10 come with Python 2.6 pre-installed, but Google App Engine still runs Python 2.5 (an issue has been created to add Python 2.6 support, make sure...

Foller.me Has Got a New Home: Google App Engine

That’s right, Google App Engine! For those of you who don’t remember, Foller.me is a Twitter app I wrote back in 2009. Honestly, I never realized back then that performance is an issue until the day I got featured on Mashable. More about it in a previous post. If you’re not familiar with Foller.me, I’ll explain it here in a couple of words: Foller.me is a web application...

Facebook Fans Count Using Python and the Graph API

I noticed some peeps struggling to show off their Facebook fans count on their websites using the Facebook API. I’ve shown before on how to do it in PHP, and this quick post is about Python. Honestly, you’ll laugh as soon as you read the following three lines of code: import facebook graph = facebook.GraphAPI() print "Mashable has %s fans" % graph.get_object('/mashable')['fan_count']...

A Brief Introduction to Google App Engine

If you’ve been following my tweets you might have noticed that I’ve been running around Python and Django and Google App Engine for the last few weeks. Honestly, I fell in love with Python the second I wrote my first few lines of code, but it is not what this post is about. This post is about my short experience with App Engine. My first experience with App Engine was back in 2009...