[Baypiggies] Code/Idea Review (WARNING: SPOILER)

Aahz aahz at pythoncraft.com
Sat Dec 15 21:20:50 CET 2007


[quickies only, I need lunch]

On Sat, Dec 15, 2007, Glen Jarvis wrote:
>
> 1  #!/usr/bin/env python

Most people these days tend to favor specifying a direct path to Python
for two reasons:

* It's slightly less security risk (if something mucks with your path)

* You can use another command-line parameter if necessary

> 6  alpha_list=map(chr, range(ord('a'), ord('z') + 1))
> 7  alphabet_=string.join(alpha_list, '')

Python is the whitespace language, use lots of it -- appropriately, of
course:

alpha_list = [ chr(c) for c in range(ord('a'), ord('z')+1) ]
alphabet = ''.join(alpha_list)

You'll also notice that I've changed your Python 1.5.2 code to match more
current versions; if you sincerely are targetting 1.5.2, by all means
stick with what you have.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Typing is cheap.  Thinking is expensive."  --Roy Smith


More information about the Baypiggies mailing list