Re: Comments on my first script?

2008-06-14 Thread [EMAIL PROTECTED]
On 13 juin, 17:24, Lie <[EMAIL PROTECTED]> wrote: > On Jun 13, 3:19 pm, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: > > Phillip B Oldham a écrit : > (snip) > > >try: > > >for line in rec.split("\n"): > > >bits = line.split(': ') > > >a = bi

Re: Comments on my first script?

2008-06-14 Thread [EMAIL PROTECTED]
On 13 juin, 13:39, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote: > On Fri, 13 Jun 2008 10:19:38 +0200 > > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > > Ok, since you asked for it, let's go: > > Good commentary. One small improvement: > > > REC_CLEANERS = { > > '.net' : clean_net, > >

Re: Comments on my first script?

2008-06-13 Thread Lie
On Jun 13, 3:19 pm, Bruno Desthuilliers wrote: > Phillip B Oldham a écrit : > > > I'm keen on learning python, with a heavy lean on doing things the > > "pythonic" way, so threw the following script together in a few hours > > as a first-attempt in programming python. > > > I'd like the community'

Re: Comments on my first script?

2008-06-13 Thread Lie
On Jun 12, 10:10 pm, "John Salerno" <[EMAIL PROTECTED]> wrote: > "Phillip B Oldham" <[EMAIL PROTECTED]> wrote in messagenews:[EMAIL PROTECTED] > > > I'd like the community's thoughts/comments on what I've done; > > improvements I can make, "don'ts" I should be avoiding, etc. I'm not > > so much bot

Re: Comments on my first script?

2008-06-13 Thread D'Arcy J.M. Cain
On Fri, 13 Jun 2008 10:19:38 +0200 Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Ok, since you asked for it, let's go: Good commentary. One small improvement: > REC_CLEANERS = { > '.net' : clean_net, > '.com' : clean_com, > '.tv' : clean_net, > '.uk' : clean_co_uk, > (et

Re: Comments on my first script?

2008-06-13 Thread Aidan
Chris wrote: On Jun 13, 9:38 am, Phillip B Oldham <[EMAIL PROTECTED]> wrote: Thanks guys. Those comments are really helpful. The odd semi-colon is my PHP background. Will probably be a hard habbit to break, that one! ;) If I do accidentally drop a semi-colon at the end of the line, will that cau

Re: Comments on my first script?

2008-06-13 Thread Bruno Desthuilliers
Phillip B Oldham a écrit : I'm keen on learning python, with a heavy lean on doing things the "pythonic" way, so threw the following script together in a few hours as a first-attempt in programming python. I'd like the community's thoughts/comments on what I've done; improvements I can make, "do

Re: Comments on my first script?

2008-06-13 Thread Chris
On Jun 13, 9:38 am, Phillip B Oldham <[EMAIL PROTECTED]> wrote: > Thanks guys. Those comments are really helpful. The odd semi-colon is > my PHP background. Will probably be a hard habbit to break, that > one! ;) If I do accidentally drop a semi-colon at the end of the line, > will that cause any w

Re: Comments on my first script?

2008-06-13 Thread Phillip B Oldham
Thanks guys. Those comments are really helpful. The odd semi-colon is my PHP background. Will probably be a hard habbit to break, that one! ;) If I do accidentally drop a semi-colon at the end of the line, will that cause any weird errors? Also, Chris, can you explain this: a, b = line.split(': ')

Re: Comments on my first script?

2008-06-12 Thread Chris
On Jun 12, 4:27 pm, Phillip B Oldham <[EMAIL PROTECTED]> wrote: > I'm keen on learning python, with a heavy lean on doing things the > "pythonic" way, so threw the following script together in a few hours > as a first-attempt in programming python. > > I'd like the community's thoughts/comments on

Re: Comments on my first script?

2008-06-12 Thread John Salerno
"John Salerno" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> if domain.endswith(".net"): >> rec = clean_net(rec) >> >> if domain.endswith(".com"): >> rec = clean_net(rec) >> >> if domain.endswith(".tv"): >> rec = clean_net(rec) >> >> if domain.endswith(".co.uk"): >> rec = clean_co

Re: Comments on my first script?

2008-06-12 Thread John Salerno
"Phillip B Oldham" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'd like the community's thoughts/comments on what I've done; > improvements I can make, "don'ts" I should be avoiding, etc. I'm not > so much bothered about the resulting data - for the moment it meets my > needs. Bu

Comments on my first script?

2008-06-12 Thread Phillip B Oldham
I'm keen on learning python, with a heavy lean on doing things the "pythonic" way, so threw the following script together in a few hours as a first-attempt in programming python. I'd like the community's thoughts/comments on what I've done; improvements I can make, "don'ts" I should be avoiding, e