Live data from Hacker News

Learn Python in minutes

learnxinyminutes.com

31–40 of 59 posts

Re: Learn Python in minutes

#31
post #11

Nice and concise. It would be complemented nicely by a list of Python "gotchas". E.g., off the top of my head, mutable default arguments, or trying to catch multiple exceptions with "except Exception1, Exception2:". That's the kind of thing people new to the language can spend a lot of time debugging when they first run into it. Edit: and any introduction to tuples should probably show how to write empty and one-elem…

Author here.

I didn't want to overload the reader. Perhaps a more in-depth guide is required.

Re: Learn Python in minutes

#32

I think you mean to say "glance over and quickly forget the basics of python in minutes"

Author here.

How would you improve the retention rate?

This article is meant for programmers from other languages who want to quickly look up a language specific detail.

Re: Learn Python in minutes

#33
post #18

int, boolean, float etc. are not _primitive_ data types in python. If you say that, you really have no idea, what you are talking about. They are objects like everything else. You can inherit from them and do all the good OO stuff. Sorry for the nitpicking, but calling them primitive types, is just plain wrong.

Author here.

Sorry for that. I know they are objects but if you consider everything an object then really you have no primitives except object itself. Certainly this has a place in programming philosophy but not really a helpful point in a language-primer/cheat sheet.

Re: Learn Python in minutes

#34

Having just recently learned Python the "hard" way, I really wish I would've seen this beforehand. Even having done some hands-on work and a lot of Googling, I picked up a few new things from this I hadn't seen before. Thanks!

Author here.

That would've been impossible because I wrote that 2 days ago =]

Re: Learn Python in minutes

#35
I would love a version of this that is incredibly comprehensive. I mean like, go over the entire Python doc in this format. Don't get me wrong, this goes over a lot, and but there's still a lot missing.

Re: Learn Python in minutes

#37
post #4

Having just recently learned Python the "hard" way, I really wish I would've seen this beforehand. Even having done some hands-on work and a lot of Googling, I picked up a few new things from this I hadn't seen before. Thanks!

Same here, I just went through the same course. (Learn Python the hard way). Coming from a php background I had (and am having) problems wrapping my head around the packaging section. I started to lose interest because of it. It's as if I hit a wall. Can any Python hackers offer some good resources for learning more about packaging?

Hey Zed here, are you talking about exercise 46?

http://learnpythonthehardway.org/book/ex46.html

If you email me with the problems you had I'll see what's wrong with the exercise and figure it out. There was a particularly stupid ordering problem with it where I had people install requirements after they needed them, so go double check it again and see if it got better.

Also, email me help@learncodethehardway.org with what you ran into. If you're in San Francisco I'll even meet you in person to figure out what you're doing live (works way faster).

Re: Learn Python in minutes

#40
"""-delimited text is not actually a comment. Its a multiline string literal

    x = """aaa
    bbb"""
And you can also use single quotes if you want.

    x = '''aaa'''
The reason this might have been confused with a comment is because triple-quoted strings are often used for documentation strings, a Python feature that gives special meaning to string literals that occur as the first statement in a function or class. Those strings get associated to the function as its documentation and can even be inspected at runtime:

    def foo():
       "my documentation string"
       return 17

    print help(foo)
Post reply on HN