top | item 1841359

Offer HN: I'll help you learn Python

68 points| jdunck | 15 years ago | reply

I've been doing Python professionally for 4 years now, including Django (sys admin to front end), GIS, and some basic machine learning.

Some pre-reading would be most effective so you'll have specific questions. If you already know how to code and are picking up Python, I recommend http://diveintopython.org/ . If you are new to programming, I recommend http://learnpythonthehardway.org/index

Email me to agree on a schedule; I'd prefer Freenode IRC if you want to chat.

50 comments

order
[+] anthonyb|15 years ago|reply
Plug: I'm just in the final stages of finishing an introductory Python book, Hello! Python: http://manning.com/briggs/. It's a bit different, in that I'm using real world projects (Hunt the Wumpus, Django, web scraping, writing games) to demonstrate how to program, rather than just having a laundry list of features and stepping through them one by one.

Think of it as Land of Lisp, but in Python rather than CL.

[+] inovica|15 years ago|reply
I took a quick look. As its a paid-book I think it would be useful to have at least one of the exercises open for people to see. I appreciate the introduction is available to download, but the real-world projects aren't (and I understand why) but my suggestion would be to open one of them so that we can see what kind of exercises in real life
[+] edanm|15 years ago|reply
That's a great idea. I've thought of writing something like that myself, but with a focus on learning Django (for people who already know Python.)

Do you think there is any interest in such an ebook?

[+] mkramlich|15 years ago|reply
I was almost the co-author of that book. :)

Hi Anthony, awesome to see it coming out! Great job! I'll check it out.

[+] jdunck|15 years ago|reply
Thanks for this, I've been annoyed that Python doesn't seem to have a book that's fun for beginners.
[+] joag|15 years ago|reply
I'm trying to learn python and I picked learn python the hard way by Zed Shaw, I don't have a programming background I'm more like a sys-admin combined with a degree in Electrical - Electronic Engineer and the book is really good.

I was able to follow the book very well until I got into chapter 23 "Read Some Code", I thought it was a good idea to learn the lansom code as he created it but as I'm learning python and at the same time learning to program the concepts of packages and API's all combined together just didn't help me, so I started reading code from http://inventwithpython.com/, chapter 9 specifically where the real code start to show up; the code in the book is just one file so you can leave packages and API's until you get more background.

I providing my personal experience because I'm sure that even HN is a site for programmers there is a fair amount of guys here like me just starting in the world of programming and this can help them a bit.

BTW, if some one drops the offer I'll willing to take his place because I really want to learn python + django.

[+] pavel_lishin|15 years ago|reply
I tried installing lamson, fwiw. After two days of googling and having some friends who know what they're doing, python-wise (jdunck's former coworker, actually) we FINALLY got it up and running. Barely.

So yeah. My experience says, stay away from lamson as a learning tool.

[+] rguzman|15 years ago|reply
Shameless plug:

If you are interested in learning python+django intensively for a week with a few people, I'm co-teaching a class with Dave Beazley in Chicago next month. There is still a few seats left. http://www.dabeaz.com/chicago/index.html

[+] jdunck|15 years ago|reply
Cool -- if you're new to Python, you may not be familiar with Dave's work. He's awesome. Consistently one of the best presentations at each PyCon.

@rguzman - do you know who runs hnofficehours.com? I found some bugs. :-/

[+] joag|15 years ago|reply
Sadly to say I don't leave in the US, so I have to learn by my self and with tips and ideas from others. I think programming is a mindset you born with and I think I have it, but discovered it late.
[+] Jun8|15 years ago|reply
My question is: I don't know any Python and would like to start learning it. Should I bypass Python2 altogether and start with Python3 or stick with Python2?
[+] andymorris|15 years ago|reply
You should definitely learn Python 2. Almost all libraries still are on 2, so if you tried to go straight to 3, you'd have to struggle your way around most newbie documentation on the internet - Especially if you're planning on doing Django work.

Anyway, there isn't a whole lot of difference between python 2 and 3, really. The "proper" way of coding in python2 is very similar to python3.

[+] fraserharris|15 years ago|reply
If you would like to use App Engine (great & free!), then stick with Python 2.5 for now.
[+] f1gm3nt|15 years ago|reply
I've been wanting to learn python for a long time. I have even bought a big arse book and have been to those sites and have read them. I come from a web application background and the biggest challenge I have with learning python is that I never seem to have a reason to use it.

So what type of application would you recommend python for? What do you normally use python for?

[+] anthonyb|15 years ago|reply
Pretty much anything - Python's a multi-paradigm language. Web development, system admin, desktop apps, games, console programs - it doesn't really matter.

Some of your workflow or setup might be a little different, eg. Django vs. PHP, but not so much that you'll be completely lost.

[+] awakeasleep|15 years ago|reply
How did you teach yourself about how Python classes work, and about the differences between names and objects and scope and stuff like that.

I have some resources that I could re-read to learn more, and I could do experiments myself, but as a sysadmin python user, I'd like to know how you picked it up, for perspective's sake.

Thanks for the offer!

[+] jdunck|15 years ago|reply
I already had taken a programming languages course in college, so had a fair grasp of different approaches. I've dev'd professionally in a fair number: http://mytechne.com/user/jdunck/programming-languages/

So, learning Python was sort of just picking from the menu; DiP was perfect in this regard, as it related python's features to other langs you might know.

Given your different context, I think it might be helpful to just see some examples and play in the shell, though.

[+] Luyt|15 years ago|reply
Are you sure you want to recommend "Dive Into Python"? It has some flaws, which are discussed by Zed Shaw at http://oppugn.us/posts/1272050135.html

Basically he says the book is outdated and not maintained, and has bad examples.

[+] dkokelley|15 years ago|reply
I know you only have a limited amount of time to help others learn, so you can't take on any more pupils. Would you be willing to document your instruction and work it in to a syllabus of some sort for the rest of us? I'm gonna start with the reading you recommended. Thanks!
[+] Ixiaus|15 years ago|reply
While I applaud the author's effort to help, I can assure you that you are capable of this on your own without any tutoring. If you know how to program then skim through Dive Into Python and think up a fun little project for you to do, then finish it.

I recommend a web application project because it forces you to learn a lot of different moving parts - pick a framework and study their code. Try to build your own basic wsgi framework.

Just to show and tell so you know I'm not coming from a Mr. Superior stance: http://bitbucket.org/ixmatus/rubedo/src/tip/rubedo/

Use it if you want - it was my attempt at building a (somewhat) Py3k compatible wsgi framework. MVC with really minimal routing and super simple configs. The request class I spent a lot of time on and had been studying the WebOB sources a lot (hence the resemblance). Doing that actually made wsgi apps and the "pythonic" way of building web applications click for me (coming from a PHP background).

[+] FrancescoRizzi|15 years ago|reply
awesome! I am barely dipping my feet in this area, specifically using Django - so I have a quick question for you. I'm setting up the dev environment on a Windows machine; should I go with BitName Django Stack ( http://bitnami.org/stack/djangostack ) - but it seems to have an older version of Django itself, or fo through all the manual steps ( http://docs.djangoproject.com/en/dev/intro/install/ ) ? Is there, by chance, an easy way for me to use the BitNami stack and then manually update the django version inside of it to get 'best of both worlds' ? Thank you in advance!
[+] shimon|15 years ago|reply
According to http://bitnami.org/files/stacks/djangostack/1.2.3-0/changelo... , BitNami includes Django 1.2.3 as of 2010-10-08. That's the latest release of Django.

But even if that version were a little old, it's probably more important to get up and running with something rather than spend lots of time tweaking the environment. I'm a linux user, so I haven't tried BitNami, but it seems like a great way to get started on Windows. Using a virtual machine image (BitNami seems to have these also) under the free VMWare player is also a nice approach, but working in your main windows installation might be a more familiar place to work.

[+] whackedspinach|15 years ago|reply
I've been teaching myself python for a while, and I just built my first Django site. It works fine in runserver, but I'm having trouble deploying it. Is anyone (OP or otherwise) willing to help me understand how to go about doing that? I could really use some help.
[+] colbyolson|15 years ago|reply
I'm really bummed to have missed this opportunity. Please keep me as a reference in case someone drops out or you can take another. Many thanks.
[+] bobds|15 years ago|reply
How about an HN Python Study Group? Join #HNpython on Freenode if you are interested.

Link: irc://irc.freenode.net:6667/HNpython

[+] cheesey|15 years ago|reply
Are there any existing python study groups that python users on HN can help with as well? There aren't really that many advantages to HNers having their own channels when the more users the merrier - better to chat with non-HNers as well.
[+] zeynel1|15 years ago|reply
I've been trying to get an answer to my Python question: http://news.ycombinator.com/item?id=1841536

Maybe you can take a look at that?

[+] anthonyb|15 years ago|reply
Looks to me like you're trying to shoehorn everything into the one list, which is going to make your code hard to write. Something to note is that you're adding blank strings ('') to your list to pad it out, which is a bit of a warning sign that your data structure is wrong.

Rather than do that, I'd use a dictionary keyed off either an id or the original text, store the user input as a list after that, then sort out how to display this in the display part of your code. Something like:

    typing = {
        'Hello World': ['Hello World', 'Hello World', 'Hello World']
        'Hello Universe': ['Hello Universe', 'Hello Universe', 'Hello Universe', ...]
    }
Bear in mind that dictionaries are unordered though, so you might need to either use a list to order them, or use sorteddict from the collections library.