Posts

Showing posts from September, 2006

Python 2.5, Zope 3.3 releases

This month my favourite programming language and web framework relased newer versions. I reported Python release here: http://digg.com/programming/Python_2_5_final_released Oh! many people dugg it. But I was afraid of Zope 3 release there :) Though, I have written an article here: http://kpug.zwiki.org/WhatIsNewInZope33 Using Personal Wiki ------------------- Recently I realised that using a personal wiki for documentation is better than a public one. (Why ?). Well, the main reason is that you get more freedom and courage. I will be more cautious when adding content to public wiki. And my favourite wiki is ZWiki.

A work in progress chapter from Zope Guide

This is a work in progress chapter from Zope Guide: http://kpug.zwiki.org/ZopeGuide Please contribute! especially grammer mistakes :) Unit testing ************ Introduction ------------ In this chapter, you will learn more about unit testing. Zope 3 use `doctest` based unit testing heavily. Zope 3 preferes test driven development (TDD). To explain the idea, consider a use case. A module is required with a function which returns 'Good morning, name!'. The name will be given as argument. Before writing the real code write the unit test for this. Infact you will be writing the real code and it's test cases almost in parallel. So just create a file named `example1.py` with just the function definition:: def goodmorning(name): "This returns a good morning message" See you are not yet wrote the logic yet. But this is necessary to run tests successfully with failures!. Ok, now create a file named `example1.txt` with test cases, use ReStructuredText format...

Python talk on SFD (2)

Promode has written a good blog entry here: http://pramode-ce.livejournal.com/42465.html . As he said, my intention was to motivate the engineering students to learn Python. I got around 90 minutes. Promode's talk was also included lots of Python, because Python is used in Phoenix (http://nsc.res.in/~elab/phoenix/). It was a really interesting talk, event hough electronics was not my area of interest, I really enjoyed it. I welcome all those who attended this talk to Kerala Python User Group, more details are here: http://kpug.zwiki.org/FrontPage Hmm.. I mentioned Zope 3 too :)

Python talk on SFD

Today I had one Talk on Python at Vidya academy: http://vidyaacademy.ac.in/ I am writing this from their library. Now helping them to install Koha. This is my first Python talk, will write details tomorrow.

Sqlite usage

This is a simple tutorial(?) to use sqlite. I used pysqlite 1.0.1 in Python 2.3, which is the default in Debian 3.1 (Sarge). The latest pysqlite version is 2.3.2, Visit this site for more info: http://initd.org/tracker/pysqlite """sqlite_usage.py: sqlite module usage with examples First import sqlite:: >>> import sqlite Create a temporary directory:: >>> import tempfile >>> tempdir = tempfile.mkdtemp() Now create a db file:: >>> import os >>> dbfile = os.path.join(tempdir, 'testdb.sdb') Now connect to db and create a cursor:: >>> conn = sqlite.connect(dbfile) >>> cr = conn.cursor() Create a table:: >>> cr.execute("CREATE TABLE first_table (a INT)") Insert a value and get:: >>> cr.execute("INSERT INTO first_table (a) values (1)") >>> cr.execute("SELECT a FROM first_table") >>> cr.fetchall() [(1,)] Test comm...

Thiruvonam

Yet another Onam [1] is reached here. Tomorrow is Thiruvonam. Happy Onam to all my journal vistors! [1] http://en.wikipedia.org/wiki/Onam

A nice article by Joe Gregorio

I came across this article today: "Python isn't just Java without the compile" http://bitworking.org/news/Python_isnt_Java_without_the_compile