Hacker News new | past | comments | ask | show | jobs | submit login
Offer HN: I'll help you learn Python
68 points by jdunck on Oct 28, 2010 | hide | past | favorite | 50 comments
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.




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.


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


That's a pretty good suggestion - from what I can see most other similar books have at least one chapter that you can download. I'll see what I can arrange.

Any preferences as to which one? :)


Thanks. Thats enough for most people (including myself) to have confidence in the author and to make a purchase decision.

In terms of suggestion I too think web scraping, however it might be worth taking the most simple one so that its easy to run on from the intro.


Web Scraping .


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?


I would imagine so - although there's a fair bit of Django documentation out there, so you'd need some sort of point of difference in order to compete.

If you're serious about it I can put you in touch with someone at Manning. They're always looking for new authors and reviewers.


Thanks for this, I've been annoyed that Python doesn't seem to have a book that's fun for beginners.


I was almost the co-author of that book. :)

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


OK, folks, I've had 10 responses to this now. I think that's more than I can effectively help at once, so no more for now, thanks.


As a fallback, you can ask me questions on aim: saysauston


For those who missed this offer, you may wish to see this: http://wiki.python.org/moin/BeginnersGuide

And in particular: http://wiki.python.org/moin/BeginnersGuide/Help


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.


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.


Not bad at all, indeed I want to learn and help the project, the issue installing is just that you need lockfile-0.8 and right not the egg lockfile is 0.9.

Zed gave a hand here thought in the error you get while trying to start the server it says it has to be with that file.


Really? I didn't get a helpful error about that. It literally came down to trying various versions of lockfile, in the middle of heavy drinking and cursing the creator of lockfile, who released a minor version upgrade that broke all previous functionality.

If I'm dumb, tell me, but without basically expert help, it would have taken me like a week to figure it out, instead of two days.


I don't think you are dumb, indeed I wouldn't be able to find the right file either, as I said Zed help me on this.

Anyway try with 0.9 and start the server you'll see that lockfile was the issue, but I wouldn't know what version to install.


Oh, I see. Yeah, I realized that was the issue, but I didn't know which version I needed, either, or if it was something I was doing wrong.

I assume Zed doesn't maintain this actively anymore? The fact that it doesn't work out-of-the-box suggests so, at least.


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


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. :-/


You're off on the right track.

You should probably report it via the Github Issue tracker here: http://github.com/ezl/hnofficehours/issues

Alternately, if you'd like to hit someone up directly, the About page is a good start. http://hnofficehours.com/about/

What's the bug?


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.


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?


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.


I wish this weren't true. We all need to be pushing towards 3, and I think introducing people to 2 isn't helping the community in general -- but it is the right thing on an individual level.


If you would like to use App Engine (great & free!), then stick with Python 2.5 for now.


Or pretty much any other major Python library or framework - Django or Twisted, for instance.


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?


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.


Eh, no tool is great for everything.

I think python applies broadly, but it isn't great for building an OS. :)


I agree, I try to look at languages as tools in the toolbox. If you compare django to symfony or rails. Then I think the difference is preference. However if I'm trying to write a game for the pc then I wouldn't use php (or maybe I would [evil laugh]). So that's why I was curious what applications you would normally use it for?


Web dev, GIS, scientific, networking, machine learning, maybe some games. I agree on similar libraries in various langs, though I think community culture counts for a lot. I think the various runtimes for python is a particular strength.


We'll see - in another 12 months or so PyPy might be a lot faster...


google appengine is fun to play with.

i made my first python/appengine app over the past couple of days:

http://www.iwrotethisforyou.me/ the blog isn't mine, but see that "Random Post" button on the right? that goes to my app :D

I showed it to the author via twitter and he loved it so he linked to it.

source here: http://bitbucket.org/makeramen/irandomlywrotethisforyou

moral of the story? find random stuff to do and just dick around.


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!


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.


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.


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!


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).


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!


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.


Thank you! That's been the path I followed so far - good to hear I'm not straying from the reasonable approach!


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.


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.


How about an HN Python Study Group? Join #HNpython on Freenode if you are interested.

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


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.


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?


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.


Thanks. I am sorry that my question is not clear. In this case, the user enters a string s in a form and I append that to an empty list L = [] then I test if the last saved string is the same as the new string. If same, I write it on the same column; if not the cursor moves to next column (I was trying to do this with tables) and as long as the user types the same string the cursor stays on the same column. If a new string is typed; a new column is started; and so on.

In your example, if I understand correctly; it is assumed that there is a list of 3 "Hello World"s. In reality, each should be entered and then displayed (I use Mako templates).

This looks like a simple problem but I was unable to make it work. Thanks again.


I was just showing you what the data structure to store your text might look like. In practice there are a number of ways to do it, but you should be guided by what'll make it easiest to get your data out. In other words, you might be able to make it work with a list of lists, but you're trying to cut 'across' the list, rather than with it. So with your existing list:

list = [ ['Hello World', 'Hello World'], ['Hello Universe', ...], ... ]

you'll need to display the first item of each on one row, then the second, and so on, which is a hassle.

Another way might be to pregenerate your list of lists with blank items (assuming that you know how many different strings you have and how many tries they get) then track the current row and column number. If they enter it successfully then your current row increments by one. If they choose a different one, then increment your column and reset

But you seem to be overly focused on the details of your implementation (ie. rows and columns), rather than the simplest way to achieve what you want. A third way would be to have each series on a separate page, so you only need to track the current string. Once they're ready, they can click a button to get to the next one/enter a new string.

A fourth way - don't use a table, use <divs> with a set width and display-inline. Each <div> has the previous entries separated by line breaks, with a form for the final one. With this sort of structure you can process each list in turn, without having to worry about indexing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: