Differences between revisions 3 and 4
Revision 3 as of 2005-02-06 20:12:34
Size: 667
Editor: rba-cache1-vif1
Comment:
Revision 4 as of 2005-05-18 05:13:03
Size: 117
Editor: 209-132-174-62
Comment: changed formatting and added link to JAM/Code/PlatformFinder
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Powerful Python One-Liners = Powerful Python One-Liners =
Line 3: Line 3:
* Grab a document from the `net:
  * from urllib import urlopen;doc = urlopen("http://www.python.org").read();print doc

----
I don't like the idea of python "one-liners". For instance, in the above example, there are actually 3 statments there:

{{{
#!python
from urllib import urlopen

doc = urlopen("http://www.python.org").read()
print doc
}}}

My opinion is that this form is far more readable and clear. I propose that, rather than go for one-liners, rather go for "powerful code snippets", where we don't try to squeeze stuff into one-line just for its own sake. Thoughts on this, anyone?

CalebHattingh
----
["JAM/Code/PlatformFinder"] - This program tells you what platform you are using.

Powerful Python One-Liners

["JAM/Code/PlatformFinder"] - This program tells you what platform you are using.

Powerful Python One-Liners (last edited 2023-07-19 19:23:56 by HermannStammWilbrandt)

Unable to edit the page? See the FrontPage for instructions.