you can use regex if you want.
It gives you power to do text processing.

OO will give you benefit because your program becomes clearer while it  is developed

Cheers,
pujo

On 1/23/06, Michael <[EMAIL PROTECTED]> wrote:
Hi.

I'm processing a tab-delimited text file where I read in a file,
perform a bunch of operations on the items, and then write them out
again to a fixed-width text file.

I've been doing this with a very functional approach:

- loop over lines
- read line into dictionary
- process dictionary values ( format phone numbers and dates and
amounts, etc.)
- pad dictionary values with spaces
- write dictionary values out to file

Anyway, this all works fine. Not knowing much about OO, I'm wondering
if there's a way to approach this from an object-oriented
perspective. Is there anything to be gained? Or is this type of
problem best tackled with a functional approach?

TIA.

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to