By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,035 Members | 1,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,035 IT Pros & Developers. It's quick & easy.

An Abridged Python Tutorial

P: n/a
An Abridged Python Tutorial

There are tips for the novice and tricks
that will add to your programming kicks.
But the cardinal rule
that you must learn at school
is that spaces and tabs never mix.

If there's syntax you don't understand,
assistance is always at hand:
a glance at the cookbook,
or even a quick look
at the manual should meet the demand.

If you code without reading this doc,
you may find yourself in for a shock,
due to Python's aversion
to boundless recursion
or the global interpreter lock.

The immutable types, such as int,
can be subclassed, but follow this hint:
you must override __new__
'cause __init__ does not do -
if you try it you'll find that it didn't.

Now that functional style is passe,
filter, map and reduce go away.
Better use comprehensions
to convey your intentions
(or itertools.chain is OK).

If today's Python code doesn't suit ya,
don't despair or attack your computer.
If the time machine's on,
then your problem's soon gone:
just import what you need from the __future__.

When you harbour a yen to invent,
then a PEP should ideally be sent.
But know this in advance
your idea has no chance
should the BDFL not consent

If you find this account is amiss,
please avoid the temptation to hiss.
Simply offer a patch,
to apply with dispatch
and if you seek Zen, import this!
Michael

Jul 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Michael Spencer" <ma**@telcopartners.com> wrote in message
news:ma*************************************@pytho n.org...
An Abridged Python Tutorial

There are tips for the novice and tricks
that will add to your programming kicks.
But the cardinal rule
that you must learn at school
is that spaces and tabs never mix.

If there's syntax you don't understand,
assistance is always at hand:
a glance at the cookbook,
or even a quick look
at the manual should meet the demand.

If you code without reading this doc,
you may find yourself in for a shock,
due to Python's aversion
to boundless recursion
or the global interpreter lock.

The immutable types, such as int,
can be subclassed, but follow this hint:
you must override __new__
'cause __init__ does not do -
if you try it you'll find that it didn't.

Now that functional style is passe,
filter, map and reduce go away.
Better use comprehensions
to convey your intentions
(or itertools.chain is OK).

If today's Python code doesn't suit ya,
don't despair or attack your computer.
If the time machine's on,
then your problem's soon gone:
just import what you need from the __future__.

When you harbour a yen to invent,
then a PEP should ideally be sent.
But know this in advance
your idea has no chance
should the BDFL not consent

If you find this account is amiss,
please avoid the temptation to hiss.
Simply offer a patch,
to apply with dispatch
and if you seek Zen, import this!
Michael

Outstanding ! Great piece Michael :-)

George
Jul 18 '05 #2

P: n/a
This will be tough to beat! (and not a single rhyme of "brace" and
"space"!)

-- Paul

Jul 18 '05 #3

P: n/a
On Thu, 24 Mar 2005 08:37:29 -0800, Michael Spencer <ma**@telcopartners.com> wrote:
An Abridged Python Tutorial

very nice !

Regards,
Bengt Richter
Jul 18 '05 #4

P: n/a
Michael Spencer wrote:
An Abridged Python Tutorial
(snip fine piece of art)

<applaude>

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.