Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Tuesday, June 23, 2009

News from python struggle field

Decided not to use templating yet, but generate the html imperatively with the custom module, based on the JAxml.
Module should have simple notions of:
  • Atomic elements - paragraphs, links, text, &c
  • Grids (customizable and agile)
  • Automatic resolution of the attached pictures (through href="cid:picture1")
Don't have much time now really, hope to get on this after we release on the work :)

Friday, June 19, 2009

Searching for a good email/html....

Well. I'm searching for a good templating engine for python. For filling data (such as reports).
May be not only html, but full reporting library/set of routines.

If anyone knows - let me know.

Once I find it - I'll post results here :)

Learning python

I think I like Python very much...

I spent several days reading book about 2hrs a day, and wrote small script which reads database, prepares report, generates html content and sends this content as an email message (both html and text version, for old/specific clients).

The script is scheduled with the CRON and it just worked. So, i think this is really good result for the language you don't know.
  1. understand execution model
  2. incorporate database querying support (with named parameters, yeah :)
  3. understand how to generate html (I'm using jaxml module, it's kinda cool. creating html document just looks like doc.html().body(color="red").p(string, align="center") )
  4. understand how to send e-mail message (yes, mime knowledge gives good help, but neretheless. I'm sending this through GMAIL - so, SSL support is also here)
  5. understand how to work with dates (that's a bit ugly now, I'm sure there's better way of obtaining today timestamp than time.mktime(datetime.date.today().timetuple()) )
All this, resulting in a working solution, took for me about 6-7 hrs from the start. Without language knowledge at all :) : )

Learn python!