Re: more newbie list questions

2005-07-14 Thread Bernhard Holzmayer
googleboy wrote: Hi there. Hi googleboy! I am doing a bunch of processing over a list of lists, and am interested in doing several things taht don't seem to be working for me just at the moment. I have a list of books with several fields (Title, Author1, Author2, Publisher, ISBN) in a

Re: more newbie list questions

2005-07-14 Thread Sion Arrowsmith
Bernhard Holzmayer [EMAIL PROTECTED] wrote: googleboy wrote: I have a cell.txt file that looks like this: ++ The title is %title%. brbr The author is %author1% %author2% brbr The Publisher is %publisher1% %publisher2% brbr The ISBN is %ISBN% brbr ++ This looks like a DOS-batch-file.

Re: more newbie list questions

2005-07-14 Thread googleboy
Ali wrote: It's not really clear what you mean? Ah. sorry. Let me try again. I start with a csv that looks something like this: title, author1, author2, publisher, code, ISBN frogs of canada, andy humber, , springer press, foc2, 111-20345-556 newts of the UK, nigel snodgrass, sarah strauss,

Re: more newbie list questions

2005-07-14 Thread googleboy
Thanks for this. It ahs been very helpful. I realised that my problem using getattr were because I was trying to use it over the list of lists, instead of each book. I have written up a for loop now, and I think I am a lot closer: for book in all_books: author1 = getattr(book,

Re: more newbie list questions

2005-07-14 Thread Ali
sTemplate.replace() returns a string with that substitution. so you need to reassign it such as: sTemplate = sTemplate.replace('author1', author1) Anyway, Sion Arrowsmith above showed you a much better technique of filling all those values at once. Hope this helps, Ali --