The Python Cookbook 242
The Python Cookbook | |
author | Alex Martelli and David Ascher |
pages | 574 |
publisher | O'Reilly |
rating | 8 |
reviewer | Nice2Cats |
ISBN | 0596001673 |
summary | A recommended book for the language with no Slashdot icon. |
Beautiful plumage.
O'Reilly, fortunately, has all kinds of experience with animals.The Python Cookbook consists of seventeen chapters that contain between eight and twenty-six individual recipes. Chapters and recipes are roughly ordered by increasing complexity, length, and required background knowledge, starting with the simple "Swapping Values Without Using a Temporary Variable" and ending with the complete module "Parsing a String into a Date/Time Object Portably." The chapters are mostly organized by subject -- "Text," "Files," "Object-Orientated Programming," "User Interfaces" -- but also include "Python Shortcuts" and "System Administration." The background required varies: Whereas the chapter on "Text" starts off with Fred L. Drake reviewing the most basic string operations such as slicing and concatenation, Paul F. Dubois can only sketch the core concepts of lexing and parsing in "Programs About Programs."
This of course is a hallmark of all cookbooks, programming- or food-wise: Nobody will like everything, but everybody will like something. The worst fragmentation occurs, as expected, between examples of Python 1.5.2 and Python 2.2. Most recipes give preference to one version, and then point out how the problem could have been solved in the other version. This is more useful than the code that was written for all versions, because it gives a deeper insight into the changes that Python has gone through. The result is that after a few chapters, you start wondering why anybody in their right mind would keep using Python 1.5.2 instead of 2.2.* with its iterators, list comprehensions, new classes, and expanded module library.
Martelli and Ascher have done a good job balancing the different forms. Only one chapter struck me as lopsided: "System Administration", where ten of the sixteen recipes are Windows-only. Even though there is a good reason for this -- Microsoft's native administration tools just aren't like those provided with Unix -- the editors might want to rethink the selection of recipes in this chapter for future editions.
Generally helpful.
The "Python Cookbook" has helped me in three ways. First, I found quite a lot of the examples themselves, especially those in the chapters "Python Shortcuts" and "Object-Orientated Programming" useful for everyday work. Second, reading more than 500 pages of peer-reviewed and well-commented code gave me a greater feeling for common idioms and constructs that are rare in this clarity in wild-type code. However, the book is strongest when more general principles of "Pythonic" programming are discussed, for example when Martelli demonstrates the merits of the "Look Before You Leap," "Easier to Ask Forgiveness than Permission," and "Homogenize Different Cases" methods.My favorite recipe is Sebastien Keim's "Implementing a Ring Buffer," where an object carries a class deep in its bowels, and changes into this class in a rather cool Dr.-Jekyll-to-Mr.-Hyde transformation on the fly. The one recipe I found downright evil was "Sending HTML Mail," which should have been implemented as "Turning HTML Mail into Plain Text" with a note on how people who send HTML mail are going to be the first against the wall when the revolution comes. The best quote in the book comes from Tim Peters: "We read Knuth so you don't have to" -- Python's promise of programming power for the people, expressed in (dare I say it) a nutshell.
Conclusion:
I can recommend the "Python Cookbook" wholeheartedly to anyone who has passed into the advanced stage of language learning and is willing to actually sit down and work through the code. Anybody who is looking for a deeper understanding of Python, solutions to common coding problems, or starting points for their own projects will also profit. This book should have RedHat customers hammering at the gates of Raleigh, demanding the power of iterators and list comprehensions that their SuSE counterparts already enjoy by default; it demonstrates the superiority of Python 2.2.* over 1.5.2 in great detail.
Because of this, however, my guess is that 2.2.* will quickly replace 1.5.2, turning large parts of this book into historical footnotes in two years at the latest. This is no fault of O'Reilly's, but rather a current fact of Python life. The editors have done a good job of nailing the parrot, and until this Pythonic Norwegian Blue does the inevitable backflip, it should give its owner much pleasure.
You can purchase The Python Cookbook from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
They don't eat pythons, do they? (Score:5, Funny)
Re:They don't eat pythons, do they? (Score:5, Funny)
I didn't have the heart to tell the guy exactly what "Linux Bible, the Gnu Testament" was about...
(Then again, I probably do as much preaching about Linux as he does about God - maybe we should get it declared a religion and get tax-free status...)
Cheers,
Jim in Tokyo
Re:They don't eat pythons, do they? (Score:2)
Hey, it worked for Scientology
It isn't about them eating the pythons... (Score:2)
Trust me, it's not nearly as funny if a snake really did want to eat you when you were younger.
(Yes, one actually did, during a visit from a zookeeper to my school to show us what reptiles were really like. I was sitting at the end of a line of small children, and it started coiling around me... :-o I can handle spiders, or enclosed spaces, or high altitudes, but to this day, snakes scare the living **** out of me -- unless I'm programming in one, of course.)
Alternative Cookbooks (Score:4, Funny)
Re:Alternative Cookbooks (Score:5, Funny)
Darn... (Score:2, Funny)
Kierthos
Python cookbook (Score:2, Funny)
Or, as Homer might add: "...mmm...python"
I like python... (Score:2)
...But I couldn't eat a whole one.
SCNR. :-)
Not sure about cooking up a Python, but... (Score:5, Funny)
Cornmeal Crusted Rattle Snake with Cactus-Corn Succotash
Recipe courtesy Joey Altman, Copyright 2001
2 1/2 pounds rattle snake, dead
1 cup buttermilk
1 cup cornmeal
1 cup flour
1 tablespoon salt
1 tablespoon chile powder
1 tablespoon garlic powder
1 tablespoon paprika
1 teaspoon cayenne pepper
1 teaspoon ground cumin
1 cup vegetable oil
Cactus-Corn Succotash, recipe follows
Using a sharp boning knife remove the meat from the snake by cutting down the back, just slightly to 1 side of the spine from the head to the rattle. Using the tip of the knife peel the meat from the ?rib cage?. Once you removed the 2 long strips of meat, lightly pound them with the back of the knife to tenderize them. Cut the strips of meat into 1-inch pieces and place in a bowl with the buttermilk. Mix to coat well. In a large bowl combine the cornmeal with the flour and the spices. Heat the oil in a large skillet on medium high heat. Dredge the snake pieces in the flour mixture and fry for 2 minutes or until golden brown and then transfer to a paper towel lined plate. Repeat until all the snake pieces are cooked. Serve with Cactus-Corn Succotash.
Cactus-corn succotash:
2 tablespoons olive oil
1 cactus pad, thorns scraped off, cut into small dice
2 ears corn, shucked
1 red onion, peeled, sliced in rings, grilled with olive oil and chopped in small dice
1 bunch scallions, grilled and chopped
1 chayote squash, sliced 1/4-inch thick, grilled with olive oil and chopped in small dice
1 tablespoon minced garlic
2 tablespoons minced jalape?o
1/2 cup diced red bell pepper
4 tablespoons butter
1 cup chicken stock
1 cup diced, peeled and seeded tomatoes
1/2 cup chopped cilantro
Salt and pepper
Grilling the vegetables first gives another great layer of flavor, however, it is not absolutely necessary. Just omit that step and cook the vegetable right in the pan. In a skillet on high heat saute the vegetables except the tomatoes in the olive oil for 2 minutes. Add the stock and butter and cook until mixture reduces by half. Add tomatoes and seasoning and serve with the warm snake ?nuggets? on top.
Yield: 4 servings
Prep Time: 30 minutes
Cook Time: 10 minutes
Difficulty: Medium
Re:Not sure about cooking up a Python, but... (Score:2)
Gotta love the New-York-attorney-goes-to-the-dude-ranch sound of "Cactus-Corn Succotash". You find this sort of crap at upscale eateries in places like Aspen and Telluride. This recipe is proof that any mediocre ingredient can be dressed up enough to taste good. I've had cactus and rattlesnake. While both are edible, I'd rather have Cornmeal-crusted Amberjack with a Roasted Polenta Succotash any day.
Re:Not sure about cooking up a Python, but... (Score:1)
Re:Not sure about cooking up a Python, but... (Score:2, Funny)
BlackBolt
Obligatory Enterprise joke (Score:2)
T'Pol: It's a Klingon delicacy... But only when it's alive.
Hoshi: [Winces]
I love python (Score:3, Insightful)
But Python just rocks. Throw pySQL, wxPython and Twisted into the mix, and you can have a full blown server with gui front-end that is just as stable as any other. I have a server that I wrote for wireless devices performing a few hundred SQL queries/changes and file writes per hour, and the speed is surprisingly very good for a language most people refer to as a 'script'.
Not to mention, the tab requirement makes reading the code so easy. You just know where functions begin and end without having to deal with {'s and }'s.
Has nothing to do with language speed (Score:2)
Re:I love python (Score:2)
-Billy
Re:I love python (Score:2)
In practice, this proves to be a smaller problem than I originally expected (especially with good python bindings for my editor), and python is a beautiful language despite this minor wart, but I still consider it a problem with the language.
Debian also has 2.2 (Score:3, Informative)
Debian unstable also has 2.2 as the default python, although the stable release has 2.1. But with the huge number of packages which depend on it, it takes a while to migrate all of them. So testing still has 2.1.
Re:Debian also has 2.2 (Score:2)
Re:Debian also has 2.2 (Score:2)
The real problem was they used #!/usr/bin/python , and if you wanted to use a more modern Python as the system python (i.e., named simply "python") then you'd break system scripts. It's never been a problem otherwise to have two different versions of Python installed.
how well O'Reilly deals with dead parrots (Score:2)
Re:how well O'Reilly deals with dead parrots (Score:1)
Swapping Values Without Using a Temporary Variable (Score:2, Offtopic)
If my coffee is working correctly this morning, I'd assert that any language with an XOR-assign could accomplish this feat (with the added restriction that the vars be of the same size, or operations are performed iteratively on byte pointers).
Below is chapter 1 of my new C cookbook:
A ^= B;
B ^= A;
A ^= B;
Short chapter.
Re:Swapping Values Without Using a Temporary Varia (Score:5, Informative)
Re:Swapping Values Without Using a Temporary Varia (Score:2)
Pretty sure it works the same way in MATLAB, too, but I don't have mine here to check...
Re:Swapping Values Without Using a Temporary Varia (Score:2)
b = a + b;
a = b - a;
b = b - a;
In the case where you're using unsigned integers with wrap around semantics, yes. In the case that a,b are floats, integers on some systems (this won't work on signed magnitude systems, or in programming languages (like Ada) that have overflow checking), it doesn't work. It's nowhere as clear as "a,b = b,a", and doesn't work on general variables.
Re:Swapping Values Without Using a Temporary Varia (Score:1, Offtopic)
Re:Swapping Values Without Using a Temporary Varia (Score:1, Informative)
Re:Swapping Values Without Using a Temporary Varia (Score:2)
Re:Swapping Values Without Using a Temporary Varia (Score:2)
But why would you swap something with itself?
It would be almost impossible to achieve the aliasing in C, the only ways I can think of are:
1) swap(a,a);
2) union {int a; int b;} u;
3) #define b a
[or anything similar, i.e. int* b; b= swap(a,*b);]
I would say that if you are swapping something with itself, you have a problem with your algorithm.
Re:Swapping Values Without Using a Temporary Varia (Score:1)
it's only undefined when used like:
a ^= b ^= a ^= b;
(or whatever it usually is, i haven't memorised it 'cos it's wrong!)
doesn't python have tuples, so you can do:
(a, b) = (b, a);
(caveat: i don't know python!)
Re:Swapping Values Without Using a Temporary Varia (Score:2)
And there isn't anything wrong with implementing an old trick to get your feet wet in a new language. "Hello, world!" is a classic for a reason. When you are learning somethign new, any tie you can make with what you already know is helpful.
Re:Swapping Values Without Using a Temporary Varia (Score:2)
Tuple assignment is much more interesting, and, while showing "a,b=b,a" is trivial, showing how & where tuple assignment can be used is an important thing to pick up if you're comming from languages which don't allow such constructs.
Re:Swapping Values Without Using a Temporary Varia (Score:2)
Re:Swapping Values Without Using a Temporary Varia (Score:2)
Oops :-( (Score:2)
And even more wrong, in just about every language I know that supports an xor-assignment operator, because it modifies the same variable multiple times in one statement. :-(
Python Cookbook? (Score:2, Funny)
Pythons? I heard they taste like chicken!
No Slashdot icon! (Score:5, Interesting)
Some sort of snake, perhaps...
Re:No Slashdot icon! (Score:1)
[osdj.com]
http://www.osdj.com/2000-10/img/python.jpg
Re:No Slashdot icon! (Score:1)
Hmmmm... Your proposal intrigues me. Perhaps a snake with a parrot in it's stomach. Something like the Saint-Exuperey (sp?) rendering of a python with an elephant in it's gullet in "The Little Prince"?
Re:No Slashdot icon! (Score:4, Interesting)
If someone pulls it off, they might become famous. ;-)
Re:Python icon (Score:5, Funny)
Yeah, like the guy who drew Tux, whatshisname..
Re:Python icon (Score:2)
Slashdot topics (Score:5, Insightful)
Rather than a new topic for Python, I'd rather see a Scripting topic. So, yeah, that means no cute Python icon, but it does put all the scripting issues in one place for people to select or ignore.
Re:Slashdot topics - scripting - not (Score:2)
scripting is something can can easily do with them but should not be portrayed as a limitation.
Scripting is cool (Score:2)
Re:Slashdot topics (Score:2)
Rather than a new topic for Python, I'd rather see a Scripting topic. So, yeah, that means no cute Python icon, but it does put all the scripting issues in one place for people to select or ignore.
You mean like the current Developers [slashdot.org] section? True, it's a lot more than language related stories, but that's where you'll typically find them (except book reviews, which are usually in the Book Reviews [slashdot.org] section)
You're welcome :)
Worse than I thought (Score:2)
Anyway, you seem to be saying that next time we get a story about Ruby or TCL, we should lump them together with all the "other" programming languages, despite their kinship to other scripting languages, such as Perl, Python, and PHP.
Topics? Sections? (Score:2)
Perl comparisons (Score:3, Insightful)
It would be very instructive to me to be able to see how the two languages handle each other's idioms. I have my brain wrapped around perl and when I try to think in python I get frustrated cause things I think should be simple aren't. Of course the reverse would be true if I knew python better (I guess).
At present I think my python programming is too formal, like someone who just learned say french trying to speak it and saying "To The beloved person who bore me onto this earth; please to be informed that I have translocated my corpus into the domicale that lies here" instead of just saying "mom, I'm home".
Obligatory Monty python Hungrarian phrase book (Score:1)
May I please fondle your bum
Re:Perl comparisons (Score:2, Informative)
Re:Perl comparisons (Score:2, Insightful)
for example, consider an indexed sort. in both perl and python you could do this by writing a loop to add an index field to each value then sort it then loop to gather the ordered indices. The only difference is the loops and indexing and sorting would have different grammar.
But in perl one would probably instead do a map-sort-map idiom on a single line operation. And in python I suspect there is probably some simmilar idiom using iterators.
its the idioms, not the formal grmammar crossovers that are important to learning to learning a new language.
Perl Python (Score:2)
Then a friend twisted my arm and made me learn Python, and it wasn't necessarily that Python does OO well, but that it makes it really quick and easy to experiment. Doing so gave me sufficient understanding to go back into Perl and figure out how packages and modules and such work.
perl/python phrasebook (Score:5, Informative)
It isn't *very* long, and doesn't go too deep, and the formatting's not great, but it's a quick read, and if it doesn't fit your needs there's always that book Snowbike recommended.
At present I think my python programming is too formal
The catch about the funkiness of python's syntax is not that it demands formalism; it's just that it demands you will do only one thing per line. It's kind of hard to get yourself thinking this way, and it's really irritating to write code this way (i never write python without pining for a ?: construct, a single-line version of "except", or a less-crippled lambda construct).
The thing is, though, that obeying python's rule basically comes down to seperating each expression into unnecessary variables, and mercilessly abstracting all those potentially-repeated 'common tasks' that somehow always seem to wind up taking five lines in python into functions. However, i find when i write perl, most of the time i spend revising code is spent going back and doing the above two things-- splitting overly-complex expressions into subvariables, pulling out bits of code and making them subexpressions. Python just forces you to do these things ahead of time, and you benefit greatly in the long run. (Whether that's worth all the irritation, though, i don't know
Re:perl/python phrasebook (Score:2)
-----------------
counterexample:
print (lambda A,D,B,C,E,F,G,H,Q:"\n".join(["".join([(Q[int(__im
Re:perl/python phrasebook (Score:2)
Re:perl/python phrasebook (Score:2)
No, I write code like that all the time.
When single-stepping in the debugger, I really hate having multiple things happen in a single-step. It's so much nicer to be able to see things happen one step at a time.
Back in the really bad old days, compilers might have been dumb enough that you would get worse code when you only did one thing per line, but that hasn't been true in a long time. Your single-statement lines will be folded by the compiler. With optimizations enabled, the compiler will generate the same code from
x = foo();
if (x)
return;
as from
if (x = foo()) return;
And I know which one I'd rather single-step.
steveha
Re:perl/python phrasebook (Score:3, Funny)
Having to use a debugger at all is a sign that the code doesn't clearly express what it's going to do.
No, it's a sign that the code isn't doing what you want it to do. Sometimes that's due to a flaw in your code. Sometimes it might even be due to something else, like an API call that doesn't do what you expect, or even an API call that is downright buggy.
It's as silly to say that one should never need a debugger, as to say that one cannot do without a debugger.
a debugger that can't even tell you which expression is about to be evaluated
So, when you have a project on a platform with primitive development tools, what do you do? Refuse to work on the project?
Tell me, what development tools do you use? They must be wonderful. Maybe I should use them.
steveha
This is a fine book.... (Score:3, Funny)
2.2 for RedHat (Score:5, Informative)
Of course, installing a new version of Python in RedHat is pretty painless, download the rpm and install it. You can find them here. [python.org]
Re:2.2 for RedHat (Score:1)
Re:2.2 for RedHat (Score:3, Informative)
Re:2.2 for RedHat (Score:2)
The issue is that third-party packages depend on particular versions of Python, and you thus can't change the default version of Python between point releases.
That is, when 7.0 was released, Python 1.5.2 was the clear choice, given how little Python 2.x code existed at that point. So for the entire 7.x series, Red Hat needed to stick with Python 1.5.x as the default version. Now with the 8.x series, Python 2.2.x is the default version.
This is Red Hat's policy, and is quite sensible when you think about their userbase. They did a similar thing with Sendmail: 7.x used 8.11.x, even though 8.12 came out in the middle of the 7.x series, 7.2 and 7.3 both stuck with 8.11, because there were substantial changes with 8.12 (like no longer requiring that everything run as root...)
The goal is to make transitions within a major release as painless as possible, not only for us dumb sysadmins but also for third-party software developers: anything built against 7.0 should ideally run against 7.3 without so much as a recompile. Less ideally, you shouldn't have to port it but just rebuild it.
Re:2.2 for RedHat (Score:2)
Try Ruby! (Score:5, Interesting)
5.times {|n| puts n}
and all kinds of other crazy things. I'm not saying it's better than Python(not trying to start a flame war). I'm just saying to try it and see if you like it.
Re:Try Ruby! (Score:2)
Compare Jython, which allows Python to use Java classes (and JRuby does the same for Ruby, but isn't as far along). This is a pretty powerful combination, but it suffers from the problem that Java isn't free software (free work-a-likes are slowly emerging, but aren't feature complete).
I really think people should get excited about parrot. It has the potential to compete as a 100% open source solution with
Re:Try Ruby! (Score:2)
Parrot would be cool, but a free CLR might come around a lot faster.
I'm also unclear also how languages with significantly different semantics will interact. Ruby and Python, for instance, could interact very easily, since they have similar semantics. But Perl, for instance, considers "12" and 12 to be pretty much equivalent. But when you have some function written in Python, and you pass a string instead of a number, you're likely to get an error (or worse). So now the Perl programmer has to be aware of the languages he's interacting with, which is part of what we were trying to avoid.
It's a hard problem, and I don't know that it's easy to solve.
Re:Try Ruby! (Score:2)
Re:Try Ruby! (Score:4, Informative)
"hello world".upcase
"HELLO WORLD"
Not to mention method cascading
"hello world".upcase.reverse
"DLROW OLLEH"
Once you get used to having these features, it's hard to go back(to Perl that is...). There are a number of other very nice features as well. Iterators for example(which Perl 6 is going to include).
list = ["foo", "bar", "car"]
list.each do |elem|
# do something with elem
end
For a quick walkthrough of the languages features, go here: http://rubycentral.com/book/intro.html
I do know when I see a language which does not have an intuitive syntax or grammar.
And what language does? Any new language requires an adjustment period. The important thing is consistency once you get over the initial learning curve. Lisp doesn't necessarily have an intuitive syntax either; however, few would argue that it's not a powerful language. The consistency of having everything represented as a list makes it's syntax extremely simple.
Re:Try Ruby! (Score:2)
Problem is, if you have a simple, intuitive, grammar, then you need to have lots of words that don't have a simple, intuitive, meaning. In FORTH a good example is " (i.e., the word signified by a double-quote). This needs to do some fancy manipulation, because the language doesn't understand anything but see-it, do-it. (An even better example is (COMPILE), but that requires knowing the guts of the language.)
So, if I remember correctly, the FORTH hello-world program would be:
" Hello, World"
The first " siezes the input stream until it encounters a ", and places the address of the stuff on the top of the stack. The period prints whatever the top of the stack is pointing at. (Period might be the wrong command here, though. Which command to use where has long slipped from my memory.)
But the grammar is as simple and intuitive as possible.
Re:Try Ruby! (Score:2)
Iterators are an expression of a deeper construct in Ruby; passing code blocks to methods. Example:
File.open('foo') do |file|
# do some file operations
# maybe raise some exceptions
end # file is automatically closed the the File.open method
Funnily enough, something Python grew after Ruby had been using it for years.
Re:Try Ruby! (Score:2)
Intuitive is highly subjective. Ruby comes from the perspective of objects and method calls and passing code blocks around.
"times" is a message sent to the 5 object; a Fixnum instance. Ergo it is the same as:
class Foo
def times
# some code
end
end
i = Foo.new
i.times
The code block being passed to it (the {|i|
That's a SmallTalk thing; Ruby chose to reuse it. Typical use is more like:
[1,2,3,4].each do |i|
# do something with i
end
It's also fairly common to see:
{'a' => 1, 'b' => 2}.each do |key, value|
# do something with hash element
end
I guess the alternative would be something like:
hash.each do(key, value)
#
end
But since you can also use braces, you'd then get:
hash.each {(key,value)
Which looks a bit nasty to me.
Anyway, it doesn't take much to work out what it means even if you've never seen SmallTalk and friends. People are very good at handling different meanings in different contexts.
Re:Try Ruby! (Score:2)
Yes it does; they're very tame, and no, they're not going away: Most of the time you only see @foo, and you can hide them behind accessors and just use self.foo if you don't like them. Ala:
class Foo
attr
def initialize(bla)
if (coder_hates_at?)
self.foo = bla
else
@foo = bla
end
end
end
@foo bypasses the accessor 'attr' produces, so is a bit faster.
The $1..$9, $_ etc vars are still there, but you don't have to use those either. They're sometimes handy writing quick scripts and oneliners.
The Cookbook Online (Score:5, Informative)
four free Python books (Score:3, Informative)
Cover Art (Score:1)
Fun read too! (Score:4, Informative)
My biggest surprise is that the book is enjoyable to read. For some reason, I do not enjoy O'Reilly books as much as most programmers do, but this one is an utter delight. As someone just learning python but with plenty of programming languages and experience, I find this book delightful to read. The authors share their idioms, standard practices, and the discussion of many examples is highly instructive about the various ways to code the problem. By the end, you learn some of the subtleties of python programming from a pair of experts using polished code from a variety of gifted programmers.
I have already used some of the code, and the book got me reading some other python books as well to modify Python Cookbook examples.
Delightful book.
Re:Fun read too! (Score:2)
Re:Fun read too! (Score:2)
Selective knee jerking please! (Score:2)
Python Cookbook? Dead Parrots? (Score:2)
"How to cook a delicious meal for two with dead pythons and parrots"... *ugh!*
And yes, this is firmly tongue in cheek.
Red Hat Linux 7.3 and python2.2 (Score:3, Informative)
It had to be said (Score:3, Funny)
No no he's not dead, he's, he's restin'! Remarkable bird, the Norwegian Blue, idn'it, ay? Beautiful plumage!
Language Development Speed (Score:4, Informative)
The author of this article doesn't mention it, but many Python programmers are upset with the rapid changes in the language, and it is very contrary to Python's history and philosophy. It looks like for now though, Python is slowing back down after implementing a new system of object orientation that really implements each variable/function/whatnot as an object. 2.2, hopefully, is here to stay for a while.
HTML Email (Score:2)
Congratualations on a thoroughly short-sighted viewpoint.
HTML email is not just for spammers.
The ability to send HTML forms to employees is a boon among other benefits.
Maybe you've never shared the joy of sending an HTML birthday card to your child or parent.
Perhaps sending A4 pngs around would be more to your liking?
The ability to communicate with the richness of HTML expression should be embraced and standardised not spurned.
aw, well. smash the HTML presses
Re:HTML Email (Score:3, Insightful)
No; it's also for people who want me to want a half hour to get my mail over my modem, so I can get the exact same message but with lots of HTML tags. (And invariablly lots of HTML tags - it never bears any resemblence to clean hand-written HTML.)
The ability to send HTML forms to employees is a boon among other benefits.
And what happens when you need to make a change to that form? Why not just stick it your own private webspace?
Maybe you've never shared the joy of sending an HTML birthday card to your child or parent.
Ah, yes; the wonderous feeling of "you crossed my mind, but I couldn't be bothered to walk to the store for a _real_ birthday card".
It's a little more valid, but it's still something that can be done via web.
The ability to communicate with the richness of HTML expression
To be or not to be; that is the question. Whether 'tis greater to suffer the slings and arrows of outrageous fortunes, or by dying, end them. . .
I fail to see how this could be made richer by adding HTML. In general, just straight plain text is an extraordinarily powerful medium for communication. Frequently, HTML seems to be used as a means to doodle on the email, rather then add any information or emotional empact.
Re:HTML Email whining (Score:2)
so you'd prefer me to send you a png attachement,
or maybe an html document in a gzip?
It seems like you are troubled by the poor use of HTML email not HTML email par se.
And what happens when you need to make a change to that form? Why not just stick it your own private webspace?
It's a little thing called 'convenience'. It aids workflow. I know it's only a little step but imagine getting a letter saying "there's a picture on the noticeboard, go look at it". HTML improves the flow of communication. People are not always great at mentally task switching and when they are "reading their email" firing up a browser breaks that task.
Ah, yes; the wonderous feeling of "you crossed my mind, but I couldn't be bothered to walk to the store for a _real_ birthday card".
I'll take that as a "no". Last time I looked I couldn't embed sound and video in a store bought card.
Again, it's the immediacy that's makes the difference. Imagine opening your card and getting a note "your card is on the table" and looking to the table there is your card on public display.
Email is a provate thing, the web is a public thing. Even if it's on the LAN the psychology of it makes a difference.
I fail to see how this could be made richer by adding HTML.
For in that sleep of death, what dreams may come
HTML seems to be used as a means to doodle on the email, rather then add any information or emotional empact.
So what? Should we be disallowed enjoyment because *you* can't see any benefit?
Why do webs sites use colour, graphics, mark up, tables etc. etc. ?
because people like them
Now I do concur that having HTML mail on by default is a crazy idea. 99% of the HTML mail I receive is either better as plain text or better to not get at all.
but to suggest I should be "the first against the wall" because I want to send an HTML christmas card to my friends is short sighted, rude, offensive and promotes banality.
Re:HTML Email whining (Score:2)
Yes, if what you want to send is a bitmap graphic.
or maybe an html document in a gzip?
Yes, if what you want to send me is an html document.
It seems like you are troubled by the poor use of HTML email not HTML email par se.
Yes, but as you say
99% of the HTML mail I receive is either better as plain text or better to not get at all.
If it weren't for that 99%, there wouldn't be enough reason to support HTML email in most email clients, especially as it has had so many security holes and privacy leaks.
there is your card on public display.
Why would it be? All the webcard services give you cookies in the link to make sure it's not on public display.
Should we be disallowed enjoyment because *you* can't see any benefit?
Should we all fall silent when you enter the room, because we may offend you? It brings me absolutely no benefit, and I feel free to bitch about it. Feel free to ignore it, but I don't see why I should shut up, because you like it.
Re:asdf (Score:4, Informative)
Re:asdf (Score:2)
Re:Might actually be an interesting book to check (Score:2)
QuArK is not implemented in Python.
Scripting is implemented in QuArK, using an embedded Python interpreter.
Smack!
Re:Don't click on Slashdots book link (Score:2, Informative)
Buying from evil companies (Score:2, Insightful)
Get it from Amazon for [$3.99 cheaper]
And fund enforcement of a patent that should never have been granted. If you want to preserve balance in the Force, you have to give to EFF every time you give to a company that employs "evil" practices with respect to statutory monopolies. That's why I don't buy more than $65 a year from Disney, Time Warner, Universal, or the other big [riaa.org] nine [mpaa.org] copyright companies, and that's also why I don't buy from Amazon or use Unisys products.
Re:Arghh Python (Score:2)
Re:An indictment of the Python programming languag (Score:4, Insightful)
It's a good thing you posted AC. I wouldn't want to take credit for that dreck either.
Oh, and if Python were only two years old, then I wouldn't have been able to do the Python project I did for a client when I did.
Have you even used Python? I didn't think so. I guess that if you want to be cynical and condescending about a language just because you're a self-appointed language guru, then please go ahead. But I think we would all prefer that you keep your opinion under wraps until it is informed and rational.
Re:An indictment of the Python programming languag (Score:2)
For the record (without even using a dictionary):
their = possessive
they're = they are
there = not here
It's a typo that's all. I made a mistake.
Re:An indictment of the Python programming languag (Score:2)
The issue of tabs and spaces being mixed is well known and debated in the Python community, and mixing is considered very poor form. There are code checkers to avoid this, and Python can be run to reject mixing as a syntax error (personally, I hope this becomes the default in a later release).
I'm not entirely clear what you mean by this, "handle" is not clear term. Perhaps you mean, based on the variable name, you cannot tell the class? (Neither by name, nor by looking back in the code for a declaration on that name)This is true. Perhaps you do not understand the style of programming that Python encourages -- it's roots lie in Lisp and Smalltalk, not C or Fortran. I.e., fully dynamic typing, where an object's type is incidental, but it's properties are essential. If you don't understand that kind of programming, lack of typing will seem like a deficiency.
Not true. Variables spring into being when you initialize them. Python is not like PHP or Perl in this regard -- there is no default value for an uninitialized variable.Lack of declarations is not a large source of bugs in actual use, and those bugs that do exist are shallow and easy to fix. Deep bugs are dangerous, but this does not often lead to deep bugs (though language that allow uninitialized variables can get themselves into trouble).
It's built-in data structures are useful, and C (and even Java) are simply lame not to include them directly in the language. Lisp is another matter (though, again, the literal data types available are slim). Python tends to have fairly Lisp-like semantics, and that's okay. Designers of Python have never claimed to be revolutionary -- rather, they have tried to take the best features of languages that have come before, and create a language that puts them together in a pleasing way (unlike, say, Perl that takes every feature, throws them into a big heap, and calls it freedom). Such as? [ ] and { } are taken (and by data structures that are used more often than tuples). It works, and you get over the (x,) thing really quickly.Obviously from this critique, you have never seriously used the language. You only are able to critique its outermost veneer of syntax, and you don't have the knowledge to make any comment on the power of its semantics. The wise language designer knows semantics are more important than syntax (though syntax can get in the way, Lisp being the primary example).
Re:Why such confusion over something so simple? (Score:2)
Really, do you think these experts would have missed something that obvious?