Python Code Snippets

Behrang Dadsetan ben at dadsetan.com
Thu Jul 3 16:21:14 EDT 2003


Guyon Morée wrote:
> You're gonna love this :)
> 
> http://aspn.activestate.com/ASPN/Cookbook/Python
> 
> 
> "Aurélien Géron" <ageron at HOHOHOHOvideotron.ca> wrote in message
> news:be1hs0$111s$1 at biggoron.nerim.net...
> 
>>Hi,
>>
>>Does anyone know where I can find a lot of Python code snippets?
>>

Or you might want to just look around here. In this 
newsgroup/mailing-list one gets to see really lots of nice code.

One that I would nominate as the best test for measuring a hard-core 
python programmer would be to explain the following code without the 
context :)

Karl Scalet wrote:
 > there are very likely easier ways, but at least
 >
 > s = 'C6 H12 O6'
 > print [' '.join(xx) for xx in apply(
 >     zip,[(x[0],x[1:]) for x in s.split()])]
 >
 > gives some results,
 >
 > Karl

Once I understood the above, I beleive I will write python in my Resume...

What was this about "One simple obvious way doing it"? ;)





More information about the Python-list mailing list