I built a nice html templater!

2008-09-30 Thread Derick van Niekerk
Ok - so it's not really an awesome achievement and only handles basic templating needs (no loops and other programming constructs) but maybe someone will find it useful. It replaces any xml block where the id attribute is specified with contents provided - a description is provided in the

Re: Zope 3

2006-04-26 Thread Derick van Niekerk
This looks more or less like what I am looking for to learn Zope3! As is mentioned elsewhere in this thread Zope3 is *nothing* like Zope2 and after starting to learn the one, I knew nothing about the other. *Everything* is different - from the interface to the design methodologies. One thing Zope

Zope 3

2006-04-25 Thread Derick van Niekerk
I have been developing in PHP for some time now and needed to look into application frameworks to speed up my development. I was looking into Horde and CakePHP before I was introduced to Python. I started learing python and within a few *hours* I already wrote my first small program and I still

Re: Dictionary inserts into MySQL (each key in its own field)

2006-01-27 Thread Derick van Niekerk
[quote] d = {spam: 1, egg: 2} cols = d.keys() vals = d.values() stmt = INSERT INTO table (%s) VALUES(%s) % ( ,.join(cols), ,.join([?]*len(vals)) ) cursor.execute(stmt, tuple(vals)) [/quote] I will be using the python-mysql API. This looks like what I am looking for. I just have a

Re: Dictionary inserts into MySQL (each key in its own field)

2006-01-27 Thread Derick van Niekerk
[quote] (just curious, but from where do people get the idea that arbitrary data just have to be inserted into the the SQL statement text all the time? is this some PHP misfeature?) [/quote] I've never seen it done in this way before, but I do come from a PHP point of view. I've only started

Re: Mining strings from a HTML document.

2006-01-26 Thread Derick van Niekerk
I'm battling to understand this. I am switching to python while in a production environment so I am tossed into the deep end. Python seems easier to learn than other languages, but some of the conventions still trip me up. Thanks for the link - I'll have to go through all the previous chapters to

Re: Mining strings from a HTML document.

2006-01-26 Thread Derick van Niekerk
Runsun Pan helped me out with the following: You can also try the following very primitive solution that I sometimes use to extract simple information in a quick and dirty way: def extract(text,s1,s2): ''' Extract strings wrapped between s1 and s2. t=this is a

Re: Mining strings from a HTML document.

2006-01-26 Thread Derick van Niekerk
Thanks Guys! I've written several functions yesterday to import from different types of raw data including html and different text formats. In the end I never used the extract function or the parser module, but your advice put me on the right track. All these functions are now in a single object

Mining strings from a HTML document.

2006-01-25 Thread Derick van Niekerk
Hi, I am new to Python and have been doing most of my work with PHP until now. I find Python to be *much* nicer for the development of local apps (running on my machine) but I am very new to the Python way of thinking and I don't realy know where to start other than just by doing it...so far I'm

Re: Mining strings from a HTML document.

2006-01-25 Thread Derick van Niekerk
Thanks, Jay! I'll try this out today. Trying to write my own parser is such a pain. This BeatifullSoup script is very nice! I'll give it a try. If you can help me out with an example of how to do what I explained, I would appreciate it. I actually finished doing an import last night, but there