2nd Edition of Learn Python the Hard Way Released 167
theodp writes "Are you or your kid intrigued by Python, but not quite ready to purchase an in-depth O'Reilly book? Zed A. Shaw's 2nd edition of Learn Python The Hard Way may be a friendlier option. Shaw's path to Python programming is simple: 1. Go through each exercise, 2. Type in each sample exactly, 3. Make it run. If $60 for the hardcover is too much to ask, or $15.99 for paperback, you can spend a measly buck for the PDF/ePub download. Still too steep? OK, there's even a free online HTML edition. After completing the 52 exercises, Shaw's concluding Advice From An Old Programmer says, 'Which programming language you learn and use doesn't matter. Do not get sucked into the religion surrounding programming languages as that will only blind you to their true purpose of being your tool for doing interesting things.'"
Python the hard way? (Score:1)
This sounds like a good start (Score:3)
A month or so ago I decided to pick up a Python book at the Borders-is-dying sale, and while it's from O'Reilly, the book is too much of a reference - a lot of bottom-up "here's are six different list-like things" and "nobody expected the Spanish Inquisition, which is why you need to use this method to catch the exception it throws, but you can change that by overloading _ _ that _ _ method name's variable __pope__ or using _ComFyChaiR_ instead, but you can't set __pope__ to French, because that object uses
Re: (Score:2)
A good, free book I've been learning from is http://diveintopython3.org/ [diveintopython3.org] I find it to be much better than this book. This book gives really bad advice. For example, claiming that "vim and emacs are for professional programmers only" completely disregards that the only way to get good at either of them is by USING them for a while, a good long while, which would go so well with the message he claims to be sending with this book. Instead of stopping to learn them later, which could take months, you could be l
Re: (Score:1)
This book is aimed at beginners, people who may have no coding experience whatsoever. Not people switching from other languages.
Anyone who recommends vim / emacs to absolute beginners should be shot. They bought the book to learn python, not vim / emacs.
The reason Zed Shaw wrote this book was because he thought Dive Into Python was crap: http://oppugn.us/posts/1272050135.html
Re: (Score:2)
Re: (Score:2)
Which of Shaw's objections?
That DITP uses ODBC as "your first python program"? Good call, ODBC sucks as a way to introduce python. Something URL or HTML based would be 10 times better.
That DITP uses advanced inline stuff in the first example? I'm ambivalent. It can help to "dive in" then explain later.
Shaw's hard-man personae? OK, it's a bit over the top. But if Zed Shaw comes out with "I don't think this is the most appropriate example." rather than "DITP should be shot in the fucking face."; nobody will t
Re: (Score:2)
Not that I've read it, but I was under the impression that Dive into Python was aimed at experienced programmers wanting to learn Python quickly without all the extra fluff around learning to program getting in the way.
And I thought that Python the Hard Way was instead aimed at teaching people to program and Zed only used Python because it was a reasonably good choice for a first language.
If there's anything wrong, it's probably that beginner programmers are being sent to the wrong material.
Copy typing (Score:1, Redundant)
Re: (Score:2)
Or even just using the big, free programmers handbook for any language you can think of - Google.
Re: (Score:2)
I mean, another option doesn't seem like a bad thing.
Re: (Score:2)
The hard way part is where you're given exercises that require extending upon the example given. Providing exercises that are just the right difficulty level for someone learning, easy enough to solve and internalize the learning but not frustrating, is a very difficult thing to do as a technical author. I haven't looked at the book enough to comment on how well it does it that everywhere, but the few examples I checked look well constructed so far.
Also, to address your other comment, Python is one of tho
Code by people much better than you (Score:4, Interesting)
One of the things I really liked about C was that once you've learned a few basics like how pointers and structs work, looking at code written by people much better at C than you just makes sense and comments like /* you are not expected to understand this */ are quite rare. That wasn't as true about C++ or Java, where many kinds of things are readable (after getting the basic "object" stuff down") but some of the template stuff is too obscure. It wasn't true at all about APL or PERL :-)
I was expecting Python to resemble LISP with a different syntax, but it's looking a lot messier than even Common LISP, and of course a lot of the moving parts are hidden in the large number of pre-written modules that come with Python.
Re: (Score:2)
>> books for Python but resources for intermediate/advanced programmers are harder
I somewhat agree, I feel its like that for many languages except domain specific (e.g. graphics, database) ones for C/C++, but would like to point out two other O'Reilly ones:
Programming Python (Unfortunately, covers a bit too many unrelated, but advanced topics for me)
Python Cookbook (Recommend this one, though like it implies, all over the place. You pretty much read it online)
However, when you get into more specific
Re: (Score:2)
The "messier" comment wasn't about the visuals (I'm fine with (either) indentation or parentheses (having learned indentation on keypunch systems (and having used RPG-II and Fortrans 2,4,and Watfiv.))) The messiness is in all the special cases and nonorthoganality and other complexity - after hearing Pythonistas raving about their language for years, I was assuming it would be much neater than PERL, perhaps a Rob Pike or N.Wirth level of aesthetic purity (but still with a large number of pre-written module
With a title like that (Score:1)
I expect the language laid out in monospaced ASN.1 tables from the get-go.
Re: (Score:2)
I was hoping they'd used some Python fork where the lexer was replaced by one using APL characters or something.
Languages are different (Score:3, Interesting)
They can be in your way, they can make you jump though hoops, they can require you to create so much noise that you need tools to write anything in it (java is a prime example). If you are a truly good programmer, you want a language that does not tell you how to do things and just lets you do what you think is right. Even if that language has less extensive libraries than others.
Personally, I like Python, Lua and C at this time. Python does OO but does not force a specific, limited model on you as most other OO languages do. The one thing that comes close is Eiffel, but at the price of the compiler needing global scope. Lua is just plain elegant minimalistic and again supports OO, but as you see fit, not some restrictive inheritance model. And C just lets you do what you want, very fast if you know what you are doing, although OO, while feasible, has no language support at all. But often you can do without in C anyways. (Yes, even people that understand and like OO sometimes find that not using it is better.) In addition, all three languages are light-weight.
As to C++, I think that abomination would have been better aborted before birth. You need to know far too much about its internal execution model to write efficient code. At the same time, it is not light-weight anymore.
I also have observed that most of the Java crowd never manages to get to the level of being even mediocre programmers. To me these people look more like "library call sequencers" that could not ever do anything useful without these libraries and development tools that automatize a lot. Quite often this leads to slow, complex and insecure solutions, where the code is basically unreadable due to too much code, to many layers, too much abstractions and no insight on the part of the programmer. Sometimes Java code is 95% clutter and noise. This problem is less pronounced with other languages. One piece of advice I therefore give to anybody that wants to learn programming is to avoid Java like the plague. This is definitely only a language for quite advanced programmers, although the typical Java programmer is very far from that indeed.
Re: (Score:2)
This is definitely only a language for quite advanced programmers, although the typical Java programmer is very far from that indeed.
as a Java programmer let me tell you that this proposition evaluate to true !
Re:Languages are different (Score:5, Insightful)
Java as a base language is just fine. The problem is that the sort of problems people like to solve with Java involve things like database interaction, web applications, and user interface construction. And doing all those things turns Java programming into a giant library exploration exercise.
Many other languages end up falling into the same trap if you try to push them toward the same things Java aims at. Python for example has a pretty weak database interface layer. If you want to build a non-trivial DB app, you're likely to add both a database driver plus an ORM solution to make that work sensibly. As a PostgreSQL developer I run into psycopg2 + SQLAlchemy as an example combination. The resulting code is arguably no less "library call sequencer" than a similar solution built using JDBC + Hibernate. And the Java one also fits together into all these other "enterprise" app widgets--application servers and database connection poolers for example. You can do all that in Python, too, but you'll find yourself wandering into the same scale of library mess in the end.
Building an application development framework toolkit that doesn't feel like your language has been turned around to suit the needs of the library is a hard problem. I think one of the reasons Rails has become so successful is that it did a better job than most of avoiding that problem (albeit while giving you a whole different set of problem trade-offs to worry about instead).
Re: (Score:2)
As a person about to get into database + html design an maintenance, I would like to work with PostgreSQL. What language(s) would you recommend for the front-end interface?
Re: (Score:2)
I work with people who have built successful web application with PostgreSQL as the database store using Ruby + Rails, Java + Tomcat, and Python + various additions; at a really high level, building extensions to Django is even a popular option. Which is preferable really depends on where you intend to go with this. If you want a spot with a smaller web company, Ruby would be more likely, and giant companies tend toward Java. I can't think of a good way to stereotype the companies that prefer Python, but
Re:Languages are different (Score:5, Insightful)
They can be in your way, they can make you jump though hoops, they can require you to create so much noise that you need tools to write anything in it (java is a prime example).
While I'll admit that Java has too much boilerplate, tools are good regardless of any language you use. You don't need tools to write in Java -- people managed before fancy IDEs came along. However, because Java is statically typed, it lends itself to more powerful tools. This is really helpful as projects get bigger.
I also have observed that most of the Java crowd never manages to get to the level of being even mediocre programmers.
Oh please, cut the bullshit bashing. I could say the same thing about Python programmers, but that's just throwing insults around.
Re: (Score:2)
You don't need tools to write in Java -- people managed before fancy IDEs came along.
I'm pretty sure anyone who did that will be taking early retirement for their RSI. Java has its place but writing it unassisted is literally physically painful.
Re: (Score:2)
You don't have to hit enter when you reach the end of the textbox. There is a thing called word wrap.
Re: (Score:1)
I like python too. My *ONLY* bitch about it is beginning and ending tags that are non existent. Indent level? Really? I can NOT tell you the number of times this has created a bug for me, because the spacing was off. Had one 'flavor' where if you mixed tabs and spaces in the same file (one dev liked tabs the other spaces) or didnt put tabs on empty lines it would cause the python interpreter to go into lala land.
That is *THE* one thing wrong with python. What is this punch cards? Seriously? Indent l
Re: (Score:3)
I like python too. My *ONLY* bitch about it is beginning and ending tags that are non existent. Indent level? Really?
I think we all felt that like at the beginning. Now I get really annoyed when I have to use curly braces.
I can NOT tell you the number of times this has created a bug for me, because the spacing was off. Had one 'flavor' where if you mixed tabs and spaces in the same file (one dev liked tabs the other spaces) or didnt put tabs on empty lines it would cause the python interpreter to go int
Re: (Score:2)
You need a get text editor. :p
No, the fact the language doesn't deal with the real programmer's life issues with (eventually) bad text editor, or simply because there will always people with bad or diverging habits is python downside. The fact that one may or may not use a text editor that you consider "good" or that you think tabs or spaces are the bad way is irrelevant. You may "like it", and I can see why (like it's forcing people into doing good indentation), but do not dismiss the issues associated with it.
Non issue (Score:4, Interesting)
No, the fact the language doesn't deal with the real programmer's life issues with (eventually) bad text editor, or simply because there will always people with bad or diverging habits is python downside.
In the same way that the the it is difficult to drive nails into wood with a nail file is the downside of a nail. Once you apply the correct tool in the correct fashion the problem vanishes.
Really all you have to do is alias python to path/python -tt and there is no problem only a syntax error. Or Alternatively, I have a "bad habit" I tend on occasion to leave the semi-colon off the end of the line when writing in Perl or C. Thus both Perl and C's "downside" is that they "[don't] with the real programmer's life issues .. simply because there will always people with bad or diverging habits." Makes sense to me.
The fact that one may or may not use a text editor that you consider "good"
I wrote "... whatever text editor you have you ought to be able to set this up." If you can't then the editor is not "good," but not as a function of my personal aesthetics, but due to its lack of fitness to do its job. Are there really programmer's text editors out there that cannot substitute a tab for four spaces throughout a file?!!
You may "like it", and I can see why ... but do not dismiss the issues associated with it.
After 2 or 3 months annoyance with the tabs/spaces "issue" followed by about 10 years withoIn factut even noticing any, I think I'm entitled to dismiss the "issues associated with it."
As it happens I wasn't dismissing the issue, I was offering advice about how anyone still suffering from this issue could dismiss it.
Re: (Score:2)
The subtle difference being that a semicolon is detectable by the venerable mk1 eyeball, therefore you don't need to apply any of the bandaids you suggest.
Re: (Score:2)
The subtle difference being that a semicolon is detectable by the venerable mk1 eyeball, therefore you don't need to apply any of the bandaids you suggest.
Yes I agree, the invisibility of different kinds of white space, and not the failure of a language to make allowance for a programmer's bad habits, is the source of this "issue." However, to characterise my suggestions as "bandaids" is emotive misdirection. The issue is trivially dealt with: Set up your tools properly and it ceases to exist. Editors
Re:Languages are different (Score:4, Interesting)
Python's good.
It's quite refreshing to go to a language where (as someone with a lot of experience in programming but not much with python) with such flexible syntax that "I wonder if I can write it this way?" usually works.
And as for rapid prototyping it's great. A couple of evenings and 500 or so lines of python and I can have something that would take me weeks in C. Of course in C I would have had more fine grained control over behaviour and I do run up against barriers in python every so often.
The major downside for me is the GIL. For anything processor intensive you have to work around the language to use the resources of a modern system, rather than work with the language.
Re: (Score:3)
The multiprocessing module is your friend. When it comes to Python, forget threads.
"multiprocessing is a package that supports spawning processes using an API similar to the threading module. The multiprocessing package offers both local and remote concurrency, effectively side-stepping the Global Interpreter Lock by using subprocesses instead of threads. Due to this, the multiprocessing module allows the programmer to fully leverage multiple processors on a given machine."
Re: (Score:2)
Yes, you're probably right, I ought to take the time to learn that interface next time.
At that point in my last project (yet another fractal browser) I switched to C++ and OpenGL/CL...
Re: (Score:1)
As to C++, I think that abomination would have been better aborted before birth. You need to know far too much about its internal execution model to write efficient code. At the same time, it is not light-weight anymore.
I'm sure that since you have recommended the abortion of C++, the people who wrote Webkit, Firefox, Microsoft Office, Open Office, KDE (and most of its associated apps), Doom3 Engine, Unreal Engine, Call of Duty, Super Mario Galaxy, Halo (and every AAA game ever basically), etc. will realise their incompetence / lack of experience and switch to C, Lua or Python since those are your personal preferred languages "now".
C++ is a heavy-weight language, but it does not generate heavy-weight or poorly optimized co
Re: (Score:2)
As to C++, I think that abomination would have been better aborted before birth. You need to know far too much about its internal execution model to write efficient code. At the same time, it is not light-weight anymore.
I'm sure that since you have recommended the abortion of C++, the people who wrote Webkit, Firefox, Microsoft Office, Open Office, KDE (and most of its associated apps), Doom3 Engine, Unreal Engine, Call of Duty, Super Mario Galaxy, Halo (and every AAA game ever basically), etc. will realise their incompetence / lack of experience and switch to C, Lua or Python since those are your personal preferred languages "now".
C++ is my favorite language too, but let's be honest -- lots of software which sucks has been written in C++. It's a language which has had the misfortunate to be hyped in the past, and co-hyped with Object Oriented Everything.
On the other hand, when people like the grandparent can claim to like C and still call C++ an abomination I can only attribute that to ignorance. Just see what a typical non-trivial C program uses instead of the standard C++ containers -- typically a mess of buffer overflows, memory
Re: (Score:2)
You mistake me. Containers are the one thing done better in C++ than in C. However, I found that with just a very small number of OO-style containers in C, the problem goes away. Of course most people claiming to understand OO would not be able to do it in a non-OO language.
Re: (Score:2)
Having seen some things out of Google, I know that they are not the wizards some people still believe they are by a fairly large margin. You find tremendous arrogance there and you find many fans that take in anything Google without question.
Re: (Score:2)
Thank you, I have learned C++, have the standard and consider it unsuitable for almost any task, except maybe an OS kernel. (Which was the original target AFAIK.) A combination of C and OO capable scripting is far more powerful, but requires you to actually know what you are doing on a conceptual (not language) level. I have used this approach with very good success and all of Perl, Python and Lua for the scripting. I saw what happened when my tools were ported to C++. Essentially they became hard to compil
Re: (Score:2)
Re: (Score:2)
The thing about abstraction is, if you overdo it, it does not help understanding at all, it just obscures necessary detail. True, finding the right level of abstraction is more art than science. The experience that I have made doing code review for Java, is that often there is abstraction for abstractions sake and you have to dig through layer after layer until you finally find one where something actually happens. This is hugely counterproductive, makes the code slow, bloated, hard to read and understand.
Re: (Score:2)
Well, in my experience, Java is complex (as you cannot stay in the core language if you want to get anything done), slow, a memory hog, has inconsistent library interfaces, and cross-platform development requires you to know each platform in question. Also, it is neither low-level (as C or C++), nor high-level (as, e.g. Eiffel) nor scripting (as Python, Perl or Lua). It wants to do everything and as a consequence is worse than most other tools at anything.
Re: (Score:2)
There is a difference between learning and using. I advise people to stay away from Java and C++ for learning. Once they are competent programmers, they can use whatever tool is handy.
From lesson 0 (Score:5, Funny)
Re: (Score:1)
"A programmer will eventually tell you to use Mac OSX or Linux. If the programmer likes fonts and typography, they'll tell you to get a Mac OSX computer. If they like control and have a huge beard, they'll tell you to install Linux. Again, use whatever computer you have right now that works."
I run Windows because I like to play games :)
Ignoring the joke aside question (Score:2)
Does OSX actually have any advantages over any other OS when it comes to typography?
Re: (Score:2)
I think most all of us have long since come to a, "use whatever
Other Free High-Quality Tech Books/Writing? (Score:3)
Philip Greenspun has some good titles: Philip and Alex's Guide to Web Publishing [greenspun.com] (dated, but I paid cash money for it back in the day), Software Engineering for Internet Applications [greenspun.com], and SQL for Web Nerds [greenspun.com]. If you find yourself in the DB2 world, Graeme Birchall's DB2 SQL Cookbook [verizon.net] is a must-have.
Pro Git (Score:2)
Pro Git [progit.org] is a great resource if you want to get into Git. (You can buy a dead tree version as well.)
Only a limited starter no Python (Score:1)
Looks like a good attempt on programming, but if I am starting on Python today, I'd prefer using the current version.
This is a good price-point; yet, if you want to do anything more than an evening with Python, try...
http://diveintopython3.org/ [diveintopython3.org] or
Computer Programming for Kids http://cp4k.blogspot.com/ [blogspot.com]
Re:Only a limited starter no Python (Score:4, Interesting)
I have been doing Python 3 for some time. The language is better than Python 2, but you still frequently run into things that are not ported yet. So I would definitely advise either to learn Python 2 and have a look at 3 or the other way round.
For larger projects, I would advise to still use Python 2 at this time, but with a style that allows an automated upgrade later on. This will mean not using some Python 2 features.
Re: (Score:2)
I have been doing Python 3 for some time. The language is better than Python 2, but you still frequently run into things that are not ported yet. So I would definitely advise either to learn Python 2 and have a look at 3 or the other way round.
For larger projects, I would advise to still use Python 2 at this time, but with a style that allows an automated upgrade later on. This will mean not using some Python 2 features.
With features like this it is not suprising that nobody wants to use languages like Java anymore.
Re: (Score:2)
I loved this website:
http://www.trypython.org/ [trypython.org]
It's an interactive class on Python and sounds a lot like Learning Python the Hard Way.
Exercises not all that good (Score:2, Informative)
Re:Exercises not all that good (Score:4, Interesting)
... it seems a book only suited for someone with zero or negligible programming background.
It is. There is a place for such books as well. It does not hide this fact either.
Re: (Score:2)
Exercises that good (Score:2)
and then from the next paragraph:
Re: (Score:2)
Forget that, go OCW and GPL book (Score:3)
Re: (Score:2)
I thought that was a joke. (Score:2)
I'd heard of "Learn Python the Hard Way", but I thought it was a joke.
If you know any other programming language, Python is very easy.
Re: (Score:1)
Totally agree, and the best thing about python is that you usually can get very readable code often with fewer lines than the corresponding alternative you already know. Much like going from bash to perl on a complicated script, I would say
Re: (Score:1)
The book is aimed at people that don't.
Confused by the title (Score:2)
Re: (Score:2)
Yes, the "hard way" doesn't mean it's advanced, it just means you have to type again and again boring things because it's supposed to be a good learning method.
Just go through the python tutorial, it will be more effective on every aspect.
I learned Python... (Score:2)
By watching The Life of Brian, Monty Python's Flying Circus, and Monty Python and the Holy Grail
Re: (Score:2)
By watching The Life of Brian, Monty Python's Flying Circus, and Monty Python and the Holy Grail
That would be "Learning Python the Completely Different Way".
Re: (Score:2)
Yeah but nobody expects to learn it that way.
It is not just the language (Score:2)
'learn new languages in about a day".... Bullshit (Score:3)
Most of this "advice" is bullshit. The "line I've been programming for a very long time. So long that it's incredibly boring to me. At the time that I wrote this book, I knew about 20 programming languages and could learn new ones in about a day to a week depending on how weird they were. " gives it away.
Sure if you've got a background covering C you can pick up those languages based on C syntax pretty quickly - in terms of writing raw statements - but that means very little as most of the heavy lifting these days is done using the supporting libraries. Sure myself I picked up C# syntax in about that, but groking .Net to a productive level takes a fair bit longer. Even Javascript, which appears very simple for someone with a C background is deceptively simple to think you've got but you're probably missing out on the subtleties whole protoypical inheritance model. And then there's C++. Can anyone who doesn't code C++ as their day-job for less than two years really claim to have C++ and completely under their fingers?
And we haven't even considered more unusual things like Haskell or Prolog, or even Lisp where it's not just a question of the syntax. Sure if by 'picking up' you mean getting to the point of being able to code Quicksort then yes, but otherwise - well I call bullshit. And I've got over 20 years experience and an average of one language a year over that (but I'd only claim to really have half a dozen completely understood).
Re: (Score:3)
I've got almost 40 years in, and long ago lost count of languages, operating systems, and hardware environments.
You'll get past this stage.
You will never have any living computer language "completely understood" for any significant amount of time if you are working on anything more meaningful than simply tracking that language's implementation arc in a worl
Just snagged a copy (Score:2)
even a blind chicken sometimes finds a kornshell.. (Score:2)
> 1. Go through each exercise, 2. Type in each sample exactly
> Do not get sucked into the religion surrounding programming
> languages as that will only blind you to their true purpose of being
> your tool for doing interesting things.
Yes, but to type in the programming exercises, do you recommend using vi or emacs? :-/
Re: (Score:2)
Yes, but to type in the programming exercises, do you recommend using vi or emacs? :-/
The author suggests gedit, for all platforms, which is a fair enough suggestion. However he then insists on using spaces over tabs, without any explanation of the relative merits, thus already choosing a side in yet another programming disagreement. A simple "choose one and stick to it" would have sufficed.
Personally If I follow the book I'll be using vim + tabs, because those are what I'm used to and prefer, but that's just me.
Re: (Score:2)
Yes, but to type in the programming exercises, do you recommend using vi or emacs? :-/
The author suggests gedit, for all platforms, which is a fair enough suggestion. However he then insists on using spaces over tabs, without any explanation of the relative merits, thus already choosing a side in yet another programming disagreement. A simple "choose one and stick to it" would have sufficed.
Personally If I follow the book I'll be using vim + tabs, because those are what I'm used to and prefer, but that's just me.
I think that's a foolish decision.
Sure, either tabs or spaces will work fine, as long as you're consistent. The problem is that once you move beyond toy programs you will be sharing code with other developers, modifying code you get from other sources, etc. And that other code will use spaces, which means that when you mix your tab-using code with it, stuff will break.
When writing Python, follow the Python community's coding conventions, and one of the strongest and most important is to use spaces, no
Re: (Score:2)
I'm a scientific programmer, mostly working on mathematical models and simulation. Almost all the work I do is for myself, and I have very little experience working with others' code. Many of the people I know who use Python are in similar situations. I have personally had far less trouble with tabs than with spaces (aesthetically and functionally), and it's what I'm going to continue using until my circumstances change, since Python doesn't care either way (only the community, who will never see my code).
I
Re: (Score:2)
I think that believing you'll never have to share code with others is eventually going to cause you great pain. I hope I'm wrong :-)
Oh, and vim can be configured to always use spaces, but make that completely transparent to you.
Re: (Score:2)
Neither [learnpytho...ardway.org]:
If a programmer tells you to use vim or emacs, tell them, "No." These editors are for when you are a better programmer. All you need right now is an editor that lets you put text into a file. We will use gedit because it is simple and the same on all computers.
All Python programmers used to work at Google? (Score:1)
Cited from http://learnpythonthehardway.org/book/ex50.html [learnpytho...ardway.org] :
"Other Python programmers will warn you that lpthw.web is just a fork of another web framework called web.py, and that web.py has too much "magic". If they say this, point out to them that Google App Engine originally used web.py and not a single Python programmer complained that it had too much magic, because they all worked at Google. If it's good enough for Google, then it's good enough for you to get started. Then, just get back to learning to
I'll buy THAT for a dollar! (Score:2)
Sorry, had to say it...
Re: (Score:2)
I went for the ePub version. For $1, I don't mind supporting an author even if the book is below my skill level.
A Critical Review (Score:2)
I perused the chapters from start to end, skimming over all-too familiar ones, and looking at the writing and examples explained. It's a fine read for people new to programming.
It may not be very technically in-depth, may not cover all examples, and it may not warn about all the caveats, but it's a good place nonetheless.
That's the point of this book.
If you already know programming, you might find it a bit slow, and would probably prefer something like Dive Into Python [diveintopython.org].
I like the creative examples near the
Not recommended, the explanations are too thin. (Score:2)
I have done very little programming (other than excel) since my college classes in Pascal. based on the reviews here, and the fact that the book is available online for free, I decided to give this book a try.
I have gotten to this, "Try more format characters. %r is a very useful one. It's like saying "print this no matter what". Search online for all of the Python format characters."
Well, I searched online. I went to http://docs.python.org/library/stdtypes.html [python.org] and found this
Re: (Score:1, Funny)
I have a fever, and the only cure is more COBOL.
Re: (Score:2)
What format is the PDF in? Kindle? (Score:2)
When you bought the PDF, what format was it - Kindle-shaped, or letter-sized paper (A4 or 8.5x11 etc.) or something else? If it's Kindle, it looks like a good price.
Also, I was surprised by the terms of the free HTML - you're not allowed to change it! The big reason for reading it in that format is precisely to change it, by copying code examples and pasting them into your Python interpreter to see what they do :-)
Re:What format is the PDF in? Kindle? (Score:4, Informative)
You can always grab the ePub for that same $1 and use Calibre to convert it to a format the Kindle can use. I just bought it myself, looks great on my Nook.
Re: (Score:1)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Agree. I'm always being told how wonderful/portable it is but every time I try to run a Python program I get "wrong version" or something.
Chapter 0 of the book has "Make sure you install Python 2 not Python 3.". Uhuh, there's a language I want to invest some time in. Not.
Is there a reason why the language designers didn't put some kind of versioning into their language when they took the decision that backwards compatibility wasn't important to them? Some sort of shebang on the first line with the v
Re: (Score:2)
So, your post comes down to "I've never used python, let alone programmed in it, but I know enough to insult those who do".
I programmed in mostly C++ and java (with some lisp and ML) for 20 years before I tried python, and when python is a little sluggish for my needs, I fall back on them but I hardly ever need to. Maybe you're the one who can't be bothered to learn something new and are looking to justify that to yourself.
Re: (Score:2)
Is there a reason why the language designers didn't put some kind of versioning into their language [...] Some sort of shebang on the first line with the version number...? It's not difficult.
C:\>python
>>> import sys
>>> sys.version
'2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)]'
>>> sys.version_info
(2, 6, 5, 'final', 0)
You were saying?
Re: (Score:2)
It's your loss. I spent a lot of time learning "proper languages" before getting around to trying Python.
When I finally got around to looking at the language, I regretted not learning it sooner. I was able to both learn the language and write the program that I needed in less time than it would have taken me using the languages I already knew.
Python is a handy tool to have available. Sure, it isn't the best tool for every job, but neither is duct tape.
Re: (Score:2)
Sacrilege! How dare you besmirch the holy duct tape! Burn him! Burn the heretic!
subjective much? (Score:2)
Agree. I'm always being told how wonderful/portable it is but every time I try to run a Python program I get "wrong version" or something.
Chapter 0 of the book has "Make sure you install Python 2 not Python 3.". Uhuh, there's a language I want to invest some time in. Not.
Is there a reason why the language designers didn't put some kind of versioning into their language when they took the decision that backwards compatibility wasn't important to them? Some sort of shebang on the first line with the version number...? It's not difficult.
The other setup advice, ie.: Open Edit->Preferences select the Editor tab. Change Tab width: to 4. Select (make sure a check mark is in) Insert spaces instead of tabs. Turn on "Automatic indentation" as well.
Doesn't inspire me to learn Python either. Why impose a rigid spacing structure on a language in a world where tabs aren't standardized (and never will be)?
That's only the convention the author is using. Python spacing rules are more flexible than that. If you wanted to really know them you could have googled it a long time ago. As for the rationale (again, google it?) it does make up for much readable code. I know that for some it is an idea that they cannot stomach, but readability as part of the syntax is a good think.
And as of why, have you ever had to face code with horrendous indentation or no indentation at all? Specially when people mix code with mar
Re: (Score:3)
Oh, you think watching Python on VHS is the hard way, do you? Why, in my day, if we wanted to see a good Monty Python skit we had to go kidnap the performers, construct a set, and buy enough booze to get them drunk enough to perform. VHS? Luxury.
Re: (Score:2)
You started with a universe having elements in it, did you?
Re: (Score:2)
a universe. In my day we had nothing but a singularity.
Re: (Score:2)
Programming Perl is pretty awesome.
Re: (Score:2)
it does this. the extra credit on each exercise gives a challenge based on what the basic goal of the exercise was. I havent looked through all of these to find if there are some that are especially exciting or fun, but the chance at a bit of entry-level creativity is there.