Archive for the ‘Python’ Category

Python’s Django – Database Interactions

Tuesday, October 4th, 2011

This post is a work in progress. Currently, we define what a couple views may look like and in those views, we perform various useful database interactions. (more…)

Generating Excel Documents With the xlwt Python Library (Examples)

Monday, April 25th, 2011

Here are some simple examples using Python’s xlwt library to dynamically generate Excel documents.

Please note a useful alternative may be ezodf, which allows you to generate ODS (Open Document Spreadsheet) files for LibreOffice / OpenOffice. You can check them out at: http://packages.python.org/ezodf/index.html
(more…)

Python and PostgreSQL: A Quick Reference to psycopg2

Thursday, March 31st, 2011

As with most database technologies I interact with, I like to throw together a few simple examples as reminders on how to interface with that technology. In this case we’re interfacing with the PostgreSQL database through the Python programming language. (more…)

Implementing an Iterator in Python Example

Tuesday, March 22nd, 2011

I’ve had a incredibly difficult time tracking down useful examples of implementing iterators in Python. Up to this point all the examples I’ve found implement way more than is needed for a typical, simple iterator. (more…)

Python and Metakit: A Quick Reference

Tuesday, March 15th, 2011

If you’re new to Metakit in Python and are looking for a quick example on how to hit the ground running, please read on. The original reference (lacking in examples or explanations) is available here: Metakit for Python (more…)

Character Encoding in Python

Wednesday, January 26th, 2011

One of the largest and most revisited challenges I’ve ever encountered in Python is that of character encoding. This is a challenge which to this day which has not been solved in a reliable, intelligent or automated fashion. As such, even as I touch base on the topic I cannot guarantee these solutions will work for you. Through this process I will do my best in describing the caveats of each possible solution presented.
(more…)

Python and MongoDB: A Quick Reference to PyMongo

Tuesday, December 28th, 2010

A constant frustration of mine is working with a library which is poorly documented and doesn’t contain useful examples.

As such, I have put together the following quick reference working with the PyMongo library for interactions between Python and the MongoDB storage facility.
(more…)

Database Barrage

Thursday, October 14th, 2010

Something which has always boggled me is the use of string-based queries. We all know strings take up a lot of space, they require a lot of processing power to interpret into computer understandable information, and is an all in all bad way of transferring information. Another example of a horrible method with equally horrible implications is that of XML. Yet some how it is exactly these principles which has driven the success of SQL-type databases for years! It can only be assumed that this success is not due to the great philosophy of using string-based queries, but is instead one of ignorance and overall complacence on the end of developers and users like myself. (more…)

Interacting with Python Lists

Wednesday, August 25th, 2010

More often than not, I’m looking for a reference dealing with very specific coding situation. If I’m defining classes, then I’m probably also interested in their constructors, destructors and iterators as well. In this example, I am dealing specifically with Python lists. (more…)