Offer HN: I'll help you learn Python
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
[ 2.5 ms ] story [ 103 ms ] threadSo what type of application would you recommend python for? What do you normally use python for?
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.
I think python applies broadly, but it isn't great for building an OS. :)
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.
And in particular: http://wiki.python.org/moin/BeginnersGuide/Help
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!
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.
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).
Maybe you can take a look at that?
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:
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.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.
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.
Think of it as Land of Lisp, but in Python rather than CL.
Do you think there is any interest in such an ebook?
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.
Any preferences as to which one? :)
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.
Hi Anthony, awesome to see it coming out! Great job! I'll check it out.
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.
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
@rguzman - do you know who runs hnofficehours.com? I found some bugs. :-/
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?
Link: irc://irc.freenode.net:6667/HNpython
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.
So yeah. My experience says, stay away from lamson as a learning tool.
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.
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.
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.
I assume Zed doesn't maintain this actively anymore? The fact that it doesn't work out-of-the-box suggests so, at least.
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.
Basically he says the book is outdated and not maintained, and has bad examples.