
Ask HN: Intermediate Python learning resources? - jesusx
So I&#x27;ve completed Codecademy&#x27;s course on Python,
I have some experience fiddling with Flask and putting together random Python scripts. Generally, when I want to build something that I&#x27;ve never built before, I look up how to do it on Stackoverflow and manage to understand most of the things.<p>How can I take my knowledge to the next level?<p>Free learning resources are preferred. Hopefully ones you have used yourself when in my position.<p>Thanks!
======
ingve
If you work with other languages in addition to Python, it's easy to fall back
into old habits. You should internalize the content from these two excellent
presentations:

Raymond Hettinger's "Transforming Code into Beautiful, Idiomatic Python":

[http://pyvideo.org/video/1780/transforming-code-into-
beautif...](http://pyvideo.org/video/1780/transforming-code-into-beautiful-
idiomatic-pytho)

(pyvideo.org has a lot of other great talks and presentations.)

Ned Batchelder's "Loop Like A Native":

[http://nedbatchelder.com/text/iter.html](http://nedbatchelder.com/text/iter.html)

Python Module of the Week is also an excellent resource:

[http://pymotw.com/2/](http://pymotw.com/2/)

~~~
jeffasinger
Watching the video was worth it for realizing when you'd want the second
argument of iter()

------
incision
I'm in a very similar position.

If you really like Codeacademy, there are non-track exercises that involve
Python in the API section [0] and a couple of Python challenges [1][2] that
aren't listed.

What I'm doing now:

* Solving exercises on Project Euler in Python. [3]

* Working through each example in the Python Cookbook[4]. It was just updated to the third edition.

* Watched Guido's Painless Python talks from a few years ago [5]. I found his concise explanations of language features really helpful.

Some things I intend to do:

* Finish working through Collective Intelligence [6]. The examples are written in Python.

* Work through Introduction to Algorithms [7]. The course uses Python.

* Read, understand and give a shot at extending Openstack [8] code.

\-----

0:
[http://www.codecademy.com/tracks/apis](http://www.codecademy.com/tracks/apis)

1: [http://www.codecademy.com/courses/python-intermediate-en-
NYX...](http://www.codecademy.com/courses/python-intermediate-en-NYXmc)

2: [http://www.codecademy.com/courses/python-intermediate-en-
VWi...](http://www.codecademy.com/courses/python-intermediate-en-VWizF/0/1)

3: [http://projecteuler.net/](http://projecteuler.net/)

4: [http://amzn.com/1449340377](http://amzn.com/1449340377)

5:
[http://www.youtube.com/watch?v=bDgD9whDfEY](http://www.youtube.com/watch?v=bDgD9whDfEY)

6: [http://amzn.com/0596529325](http://amzn.com/0596529325)

7: [http://ocw.mit.edu/courses/electrical-engineering-and-
comput...](http://ocw.mit.edu/courses/electrical-engineering-and-computer-
science/6-006-introduction-to-algorithms-fall-2011/)

8:
[http://en.wikipedia.org/wiki/OpenStack](http://en.wikipedia.org/wiki/OpenStack)

~~~
kilkurdu
Aren't Project Euler's exercises seem more likely maths exercises? It's kinda
difficult for those who graduated from social sciences and tries to learn
programming from scratch.

~~~
incision
_> Aren't Project Euler's exercises seem more likely maths exercises?_

Project Euler does involve a math, but so does efficient programming.

Efficiency can seem a pretty abstract thing and it might not crop up right
away in more typical programming tasks. Working a Euler problem and refining
to a solution that runs in 1% or 0.001% of the time required for the most
straightforward solution is a great demonstrator.

 _> It's kinda difficult for those who graduated from social sciences and
tries to learn programming from scratch._

Sure, but the context of the question here isn't really from scatch. The OP
has already completed at least the 296 exercises in the Python track at
Codeacademy to establish a base.

Personally, I haven't graduated from anything and I treat the Euler exercises
as an interesting way to practice/learn a bit of programming and math.

------
shubb
I'm enjoying 'Data Structures and Algorithms using Python'[1]

Coming from a C++ background, I felt uncomfortable using python as more than a
glue/scripting language, because the way resources are managed is treated very
magically in most tutorials.

Say I want to use the OpenCV library to fling matrices and images around, it's
hard to be confident of what the runtime is going to do with the data without
having a really good handle on what mechanisms python has for dealing with
data. Which is what this book is about.

As useful as they are for interviews, classic algorithms and data structures
are probably not a big part of most peoples work, but understanding how they
can be done in python helps you to make assumptions and use libraries in smart
ways!

Most of all, it's fun and well written, for an algorithms book. It's more
about python than algorithms, so if you were student wanting to learn
algorithms, this book is better[2].

[1] [http://www.amazon.co.uk/Data-Structures-Algorithms-Using-
Pyt...](http://www.amazon.co.uk/Data-Structures-Algorithms-Using-
Python/dp/0470618299) [2][http://www.amazon.co.uk/Introduction-Algorithms-T-
Cormen/dp/...](http://www.amazon.co.uk/Introduction-Algorithms-T-
Cormen/dp/0262533057/)

------
canibanoglu
Disclaimer: This may seem harsh but I really don't mean to be harsh.

If you have "only" completed Codecademy or similar, you're nowhere near the
intermediate mark. I have used Codecademy and Code School and they are indeed
great. But they give a false sense of security and accomplishment to the user.
They are great for introduction to a language but they only introduce you to
the language, nothing beyond that.

Don't get me wrong, I applaud you for your will to learn programming. I'm not
trying to make your accomplishments look insignificant. But I believe that, at
this point, your accomplishment is not finishing Codecademy's very very
introductory course on Python but taking the first step in the path in
learning programming.

I suggest that you take a look at Zed Shaw's Learn Python The Hard Way. The
beginning may look a bit too easy, after all Codecademy does teach you stuff.
But midway through you will probably see that Learn Python The Hard Way
introduces _beginner_ stuff that hasn't been covered in Codecademy.

After that, continue reading about Python. Sadly, the real world isn't divided
into categories marked as "Beginner, Intermediate, Advanced". Read source
codes that actually interest you. You are bound to come across stuff that you
have no idea about. Start reading about that stuff. Chances are really high
that you will come across other stuff that you don't know about when you're
reading about the first stuff that you didn't know about. You will probably
end up reading (and learning) craploads of stuff, but in my experience that's
how you really learn stuff.

I have learned this during my journey in programming. In the end, you are the
only one who knows how much you know. Don't measure your knowledge by
Codecademy's standards. They may tell you that you are intermediate but you
may not even understand how a relatively simple library works.

To anyone who will flame me for writing this, try Codecademy's or (Code
School's) courses. Try and choose a language which you don't know. Don't read
any of the info, just read what is expected of you. You will still pass the
course. That is a VERY big problem. I'm a beginner, I have felt that false
sense of accomplishment. It hurts a lot when you see what real intermediate
and advanced people do with a programming language.

~~~
brudgers
I will say, "this" thusly:

SICP is an introductory course in computing. It covers meta-linguistic
abstractions. The Code Academy course in JavaScript I completed required a bit
of filling in the boiler plate for its final project.

Code Academy is a great project, in part because it is designed to help
students achieve success without the pain of the real world. That is also a
weakness.

------
arms
Subscribe to the Pycoder's weekly email list [1]. I love looking through the
different libraries - you can certainly learn a lot from digging through
source code.

I just found out about Neckbeard Republic [2] today - it looks to be similar
to Railscasts. I haven't watched any of their stuff yet, but I plan to.

1 - [http://pycoders.com/](http://pycoders.com/)

2 -
[https://www.neckbeardrepublic.com/screencasts/](https://www.neckbeardrepublic.com/screencasts/)

~~~
srik
Those are excellent resources. I started a new screencast yesterday -

[http://pycandy.com](http://pycandy.com)

Do take a look.

~~~
whimsy
What software are you using to screencast?

~~~
srik
screeny. Its bare bones but easy to use

And good ol' quicktime to stitch it up.

------
hsmyers
I was an early adopter of Python somewhere along about v1.x. Loved it. Used my
usual technique of implementing a sizable task that I knew well---parsing PGN
(Portable Game Notation) a widely used format for recording chess games in
digital form. I've done it in every language I've learned. This is an approach
that I recommend to anyone in your position. The second thing to do is build
your reference library; easier today than before. The third thing to do is
find a community of fellow travelers. Were the language Perl, then something
like Perl Monks comes to mind. Part of your education lies in the search for
all 3---so get to it grasshopper :)

------
capkutay
Try learning about some simple sorting algorithms and implement them in
python. Most algorithms resources have pseudocode and python conveniently
resembles pseudo code in a way. You can just use wikipedia's page on sorting
algorithms[0]. You could kill two birds with one stone by sharpening your
python skills and get a nice intro to algorithms.

Then maybe try implementing some of the fundamental data structures such as
queue's and linked lists[1] along with their basic operations (such as push
and pop for queues). Try to see if you can use pythons built-in data
structures[2], or do it yourself with object oriented programming.

0:[https://en.wikipedia.org/wiki/Sorting_algorithm#Summaries_of...](https://en.wikipedia.org/wiki/Sorting_algorithm#Summaries_of_popular_sorting_algorithms)

1:[http://en.wikipedia.org/wiki/List_of_data_structures](http://en.wikipedia.org/wiki/List_of_data_structures)

2:[http://docs.python.org/2/tutorial/datastructures.html](http://docs.python.org/2/tutorial/datastructures.html)

------
taroth
Heres an applied class integrating Linear Algebra and Python:

[https://class.coursera.org/matrix-001/wiki/view?page=overvie...](https://class.coursera.org/matrix-001/wiki/view?page=overview)

This session started on Monday (July 1st) and if you have an interest in
Computer Vision, Machine Learning, or Cryptography I'd recommend you join us.

------
sourceless
Once you're past syntax and basic concepts, he best thing is probably just to
write programs. Maybe try some libraries out. And when you do something you've
never done before, (at least on small scale things) do a plan that's all your
own work (and things from the docs), and then refer to google, stackoverflow
etc. when you have problems that you can't figure out.

As well as that, look into some of the advanced language features and idioms,
and try to use them in your programs, or rewrite old programs to use them.

------
westurner
Here are three resources for learning Python for Science :

[http://scipy-lectures.github.io](http://scipy-lectures.github.io)

[https://github.com/jrjohansson/scientific-python-
lectures](https://github.com/jrjohansson/scientific-python-lectures)

[https://github.com/ipython/ipython/wiki/A-gallery-of-
interes...](https://github.com/ipython/ipython/wiki/A-gallery-of-interesting-
IPython-Notebooks)

~~~
westurner
Also, [https://www.wakari.io/gallery](https://www.wakari.io/gallery)

------
simon_weber
I'm surprised not to see my two favorite learning resources in the comments
yet: reading code and getting code reviews.

Exercises are great, but unless you have a way of getting feedback on your
solutions, you will progress slowly. Practice doesn't make perfect: perfect
practice does.

There's a lot of good code to read. I'd recommend starting with Flask - you
already have the context of using it. You might also consider checking out
something that Kenneth Reitz has written. Whenever you don't understand why
they chose to write something a certain way, ask! Both have very active irc
channels.

Speaking of irc, #python is a great place to find reviewers. There are
(mostly) friendly folks there at any time of day. You'll maximize your chances
of a good review by:

1) having a concrete question to ask: "I'm not sure about my use of kwarg
unpacking on line 12; would anyone have done it a different way?"

2) providing a small program (or section of a program) for review. People are
generous, but likely won't spend an hour reviewing a few hundred lines of code
=)

I hope that helps! Feel free to email me if you're having trouble finding
reviewers; I'm no Armin Ronacher, but I've written a good amount of Python.

------
nubela
intermediate python is what i called learning the "pythonic way". the best way
to learn imo is about fussing over if you're doing it the "pythonic way".

then you might ask: what exact is the pythonic way? then it is hard to say. on
a deeper level (that is coding style): you'd prefer list comprehensions over
for loops (not always, but for simple iterables); prefering the functional
approach -- immutable input/output on functions etc, learning map/reduce/etc;
understanding the performance kinks of python, etc.

on a higher-level, there is the python-for-humans. learn what it means to be
beautiful code, not just in terms code style, but how people will use your
code. a splendid example which i have immense amount of respect is the
requests library by kennethreitz.

retain your curiousity always. the day you lose these curiousity is when you
become a mediocre programmer. don't be that guy.

after you're done with these, go deeper. keep going. understand why the fuck
people whine about GIL, about concurrency and how bitchy it is in python (and
why), and even alternatives to python: for example. when not to use python.

i wish you the best :)

------
pooya72
I think Udacity.com has a great list of sources about programming from
beginning to advanced. Most of their classes are in Python, but the concepts
are applicable to any language. More importantly, they try to teach
fundamental concepts that would be useful in a broad range applications. I
would highly recommend CS262 Programming Languages: Building a Web Browser.

~~~
bayesianhorse
"Design of Computer Programs" contains lots of advanced concepts and
programming puzzles...

------
dfriedmn
At Thinkful (thinkful.com) we're in beta with a python class that covers
programming with python, and then web developing using flask. The syllabus
overview for the class is here: [https://www.thinkful.com/register/syllabus-
python](https://www.thinkful.com/register/syllabus-python)

------
rxdazn
Kenneth Reitz's python-guide definitely is a great resource for project
structures, workflows etc. [http://docs.python-
guide.org/en/latest/](http://docs.python-guide.org/en/latest/)

------
tbatterii
I would say you are at the point where the next level is learning by doing and
reading source code. You mentioned flask which I've been told is high quality
code, start reading the bits that you use to find out how they work.

------
bereft_orange
I'm not sure whether you are trying to learn to program in general or Python
in particular, but you might try out something like ["Design of Computer
Programs"]([https://www.udacity.com/course/cs212](https://www.udacity.com/course/cs212))
from Udacity. It's very engaging, somewhat difficult but you'll learn a lot.

Another thing you might try is taking a book with examples in one language and
try to implement them in Python. It's a little weird but it can be a great way
to have a framework for a task but have to explore on your own.

------
gtani
[http://stackoverflow.com/tags/python/info](http://stackoverflow.com/tags/python/info)
has a huge list of free books or extended tutorials

------
jbcurtin2
Learn python the hardway is a great resource. It'll not only introduce you to
some interesting quarks about the language. It's setup for daily consumption
building on the lesson previous to it. I've used it and I've used C the
hardway.
[http://learnpythonthehardway.org/book/](http://learnpythonthehardway.org/book/)
There is an ebook available for purchase and video tutorials.

------
idoescomputers
I am in the same position and have the same question. Have you tried following
Learn Python the Hard Way or reading "Think Python: How to Think Like a
Computer Scientist"? Those are to very good resources for learning Python. I
would also recommend you try reading up on data structures and algorithms.
What's your programming background? Do you know any other programming
languages?

------
grumps
I can't really say that I'm one to advise someone on learning to code but....

At some point you just have to start coding and there you'll push your
boundaries. I fooled around online python learning but didn't get far until I
built a web scrapper. I completely over engineered a one time use script just
to learn... IMHO its what can I build to learn?

------
cr4zy
If you want to build something useful, App Engine is a great way to learn
Python. That's how I learned :) Also, Pycharm is good at keeping you PEP-8
compliant, etc... The App Engine API was written very well by Googlers and a
lot of things by Guido himself like NDB, AppStats, and Rietveld(a sample app
that Google uses for code reviews).

------
quasiben
I would suggest watching any topic you find interesting at pyvideo:
[http://pyvideo.org/](http://pyvideo.org/) These are recordings from most of
the major Python conferences around the world

------
ode
Check out Python Koans -
[https://github.com/gregmalcolm/python_koans](https://github.com/gregmalcolm/python_koans)

It involves learning/hardening your Python knowledge by fixing unit tests.

------
teacpde
I am on the same boat. I think you also want to take a look at Python
challenge: [http://www.pythonchallenge.com/](http://www.pythonchallenge.com/)

------
googletron
I would definitely recommend Neckbeard Republic.
[https://www.neckbeardrepublic.com/](https://www.neckbeardrepublic.com/)

------
_if
Programmingresourc.es may have resources that are of use.

[http://programmingresourc.es/#python](http://programmingresourc.es/#python)

------
mtct
core python programming and core python application programming are two good
(not free and a bit old) intermediate python books.

Think complexity is a free python book on algorithms and science.

Python 3 Object Oriented Programming is a very good book (not free) on OOP.

------
dschiptsov
read python requests module.

