Hi! You're a beginner or intermediate, or even advanced. You want to learn mroe Python. There's so much out there: do not fret. This is a curated list of resources. I've picked and chosen. And you should go ahead and pick and choose further :)
I agree with Learn Ruby the Hard Way that the "hard way" — learning by doing — diving right in — is actually the easy way. So no matter your background, newbie programmer or advanced Pythonista, take a look and learn something new.
The first key is Don't Panic. You can learn most by hacking.
If you have not installed Python yet, you need to pick a version of Python and then install. For both of these subjects, you should read Hitchhiker's Guide to Python.
It's also a good idea to debunk the myths you may have heard about Python.
- PayPal Engineering Blog: 10 Myths of Enterprise Python (5-10 minute read)
- (And more testimonies: https://www.python.org/success-stories/
If nobody’s told you yet, Python’s community is one of the most important things about it :) Join forums, subreddits (/r/Python, /r/learnpython), chats (Slacks or IRCs) local meetups, etc., and get support. You’ll learn much better with a community.
Keep these handy.
- The official docs! https://docs.python.org/2/
- Learn X in Y Minutes: Python is a good cheat sheet.
- Flow-chart to help you get past common Python error messages
If you like self-guided courses, try one of these:
- RealPython: "Real Python teaches programming and web development through hands-on, interesting examples that are useful and fun!" (paid)
- or Dive into Python (the classic). (Note that Dive into Python 3 only covers new & advanced features in Python 3 - not the language as a whole. Don't start there.) (free)
- or Google's Python Introduction course (free)
- or How to Think Like a Computer Scientist: Learning with Python, Interactive Edition (free) — if you're relatively new to programing, this is an especially good fit for you
If you like taking online courses with a group, I’ve heard this one is good:
A lot of people think when you're first learning a language like Python, you'll grok it best if you use a basic text editor instead of an IDE. Still, maybe you are just here to learn a little Python for some projects at work, and you just need to get some things done. An IDE might help you.
- I strongly prefer JetBrains PyCharm. So do most people at my company now. And many many people the world over … PyCharm does incredible things with your Python code.
- There's a free Community Edition you can use immediately. We have Professional Edition licenses, so get your hands on one of those as soon as you can!
- (BY THE WAY, I’ve been down the path of highly customizable text editors (emacs, then vim, then Sublime Text in vim mode). I hate Eclipse and many other IDEs. Yet, I strongly recommend you check out PyCharm please. If you give it a try for a few weeks, you might just stick with it.)
- (AND ON ANOTHER SIDE NOTE, vim keybindings are awesome, and http://vim-adventures.com/ is a great way to learn if you wanna. But just because you like vim keybindings doesn’t mean you’re stuck with vim or stuck with Sublime Text. Turns out PyCharm has some of the best vim emulation on the market. (This is also true of IntelliJ and all other JetBrains IDEs))
Please try at least one of these out. Interactive tools can really deepen your understanding and accelerate your learning. A huge strength of Python is its interactivity ... Use it!
- "Python Tutor, created by Philip Guo, helps people overcome a fundamental barrier to learning programming: understanding what happens as the computer executes each line of a program's source code."
- It's amazing.
- It’s also not just Python. Various languages supported
- ipython and ipython notebook - my own notes on it - you should be using these!!!
- Use PyCharm's debugger, it is excellent. JetBrains PyCharm docs: Debugging
You're probably going to use libraries to do a lot of things. When you have a new scenario and you are thinking what should I use... You should:
- Ask your community :D
- check Hitchhiker's Guide to Python: Scenario Guide for Python Applications
- check Full Stack Python, another comprehensive but carefully curated guide, full of useful context, advice, etc.
- check Awesome Python, "A curated list of awesome Python frameworks, libraries, software and resources" — or the Pythonidae list
Free book (PDF): How to make mistakes in Python
One of Python's biggest strengths is its testability. Test-Driven Development and Python go together happily.
- start with this concise post, http://docs.python-guide.org/en/latest/writing/tests/#the-basics
- then try this comprehensive post. It's about unit testing with Python's Standard Library unit test package, but leads you up to introducing pytest — the best runner for any kind of tests (you can get started on that right away). It’s also the best framework for writing data-driven tests, when you’re ready to get gung-ho about testing your code :D
- https://www.jeffknupp.com/blog/2013/12/09/improve-your-python-understanding-unit-testing/
- When you’re ready, move onto pytest, definitely :) pytest.md
Are you intermediate or advanced? If you're not sure, one way to check:
- Ask yourself Python Interview Questions and see if you know them. If you don't, try and learn more
You don’t need to read style guides until you’re beyond beginner status. At some point that will become very valuable and helpful to you :)
- There are two main style guides:
- The Hitchhiker's Guide to Python – opinionated guide by the legendary Kenneth Reitz of requests fame
- Google Python Style Guide – perhaps the most widely-used Python style guide
- Unicode is pretty sad in Python 2.7.
- Unicode in Python, completely demystified (weird presentation format: just press spacebar to proceed through slides)
- https://pythonhosted.org/kitchen/unicode-frustrations.html
- Functional programming, list comprehensions, etc.
- Python List Comprehensions: Explained Visually
- Decorators & functional Python
- "Good to Great Python Reads" is a nice index of great Python reading (good to Ctrl+F for topics)
- Security, with this bent: learning general skills to get into InfoSec or AppSec
- Step 1, listen to this: Talk Python to Me #37: Python, Cybersecurity, and Penetration Testing
- Ignore the book Violent Python, I have heard the Python code is very bad :)
- Gray Hat Python (book 1/2)
- Black Hat Python (book 2/2)
- MartinFowler.com: "Web Security Basics" (regardless of programming language)
- There’s more, just ask me.
- Machine Learning! Here’s my guide: https://github.com/hangtwenty/dive-into-machine-learning
For completely out-of-the-box Python, concurrency is slightly complicated (because of the GIL). However, it's not some no-man's-land or something. You don't need to rediscover the solution on your own. The best single summary I've seen of (preferred) concurrency options –
Myth: Python Lacks Concurrency
but also, is concurrency exactly what you want? Maybe it is, but maybe a worker-and-queue option is more like what you want...
For Python projects that need some horizontal scale-out and fast performance, there's a good chance a worker-and-queue setup might work better for you, compared with single-computer concurrency. There's no question: Celery is the way to go for worker-and-queue systems in Python --
Or maybe not worker-and-queue. I've maintained some pretty iffy worker-and-queue systems. These days I reach for Apache Spark instead. Batch and stream processing.