I had a couple of resources I used, CodeAcademy and a basic Python course on Udemy. As far as books I used Python Crash Course and Blackhat Python. Blackhat was more learning to write my own tools for pentesting. I also looked at a lot of the tools other folks wrote on github to see how they structured things. And I asked a lot of questions. By no means try one thing when learning Python or any language for that matter. Best advise I ever got from anyone was to write code everyday.
Google's Python class is a pretty good start[0]. It's enough to get you started and moves at a nice pace! After that I'd hack on a project of my own. Even better if you have a project in mind before learning the language. This book by Jeff Knup will get you familiar with the pythonic way of doing things[1].
I would advise against Google's python course, as it is geared toward python devs working at Google. The course teaches Python 2, and goes against widely accepted guidelines such as PEP-8.
I highly recommend David Beazley's Python Cookbook (https://www.dabeaz.com/cookbook.html) for the most idiomatic and comprehensive introduction to Python.
I probably depends on your experience with other languages. At the time I learned python, I had done C++ and Java in school, and PHP professionally. I went through "Learn Python the Hard Way." It was super quick. At that point, I just started slinging Python at work and getting CRs from more experienced folk.
I had prior experience with text processing and small scripting tasks with Perl, so I found it easier to learn Python
I started with Automate the boring stuff videos, it was a good refresher to programming concepts as well. I used to conduct Perl basics workshop for my juniors at college, replacing it with Python helped me a lot - both during preparing reference notes as well as while teaching
if finding an avenue to teach (colleagues, juniors etc) is not available, start doing projects - translating something you did in another language, some project you always wanted to do, etc
for beginners to programming, I would strongly suggest Think Python and Automate the boring stuff
I used the Automate... book. I must say I never found a really good resource to move from that to OOP, unit testing etc. I put a lot of scraps together for that. 'Python 3 Object Oriented Programming' by Dusty Phillips was a help, but not the answer. Lot's of Googling did that.
A lot of people seem to dislike Zed Shaw's books, but I think the book and the accompanying videos were great. It was less to do with the content, and more to do with the forced approach towards typing out every exercise, embracing failure, and working through.
My only gripe with the content is that it focuses on the initial learning of a language. Once I finished LPTHW I felt that I knew enough to do some basic dev, but nowhere near enough to feel productive in a professional setting. I know there's LMPTHW, but it'd be nice to see Zed Shaw cover more intermediate subjects - something like Cracking The Coding Interview in the style of his Learn The Hard way series.
I had prior experience with other programming / scripting languages, and picking Python up felt very natural.
I started with Mark Lutz's Learning Python (http://shop.oreilly.com/product/9780596513986.do) about 10 years ago.
In the meanwhile I've been an active contributor to large Python-based open source projects, e.g., Salt (https://github.com/saltstack/salt) which not only that it helped me get feedback from people with a tremendous experience, but also reading through the code taught me good practices and many good ways to solve various problems.
A few months ago I started reading Luciano Ramalho's Fluent Python (http://shop.oreilly.com/product/0636920032519.do) which is just beautifully written and with a wide variety of topics for a deeper look inside Python internals.
The best book I've found for learning how to get the best from Python's language features is Powerful Python: https://www.amazon.com/d/0692878971
'Idiomatic Python' is also good, but I would suggest that more for a beginner, or for someone transitioning to Python from another language. If you have a colleague who loops through a collection by creating an incrementing their own counter variable, then give them a copy of this book.
If you already use most of python's idioms correctly (e.g. if you've learned programming primarily from resources about python), get 'Powerful Python' to learn more about how things work under the hood, and learn ways to make your code more readable and/or more efficient (for CPU and/or memory).
It points out some limitations of that book, including one specific example (the 'evil robots attacking' part) that bothered me for the same reasons it bothered the article author.
I wrote a version control system for academics in it for a course in college with no training in it and a 4 week deadline. Then I forgot about it for a year or so and when I'd picked up and played around with 10+ languages in college under similar circumstances, I remembered it was nice and switched all my hobby projects to it. I think a year later I got a paying job using it, and properly "learnt" it by working through getting awesome at something I'd screwed up or done imperfectly in a code review every week.
14 comments
[ 3.1 ms ] story [ 59.9 ms ] thread[0]https://developers.google.com/edu/python/ [1]https://jeffknupp.com/writing-idiomatic-python-ebook/
I wouldn't say that the course is geared towards devs at Python. From what I remember it's pure Python and there's nothing "Google" about it.
I started with Automate the boring stuff videos, it was a good refresher to programming concepts as well. I used to conduct Perl basics workshop for my juniors at college, replacing it with Python helped me a lot - both during preparing reference notes as well as while teaching
if finding an avenue to teach (colleagues, juniors etc) is not available, start doing projects - translating something you did in another language, some project you always wanted to do, etc
for beginners to programming, I would strongly suggest Think Python and Automate the boring stuff
My only gripe with the content is that it focuses on the initial learning of a language. Once I finished LPTHW I felt that I knew enough to do some basic dev, but nowhere near enough to feel productive in a professional setting. I know there's LMPTHW, but it'd be nice to see Zed Shaw cover more intermediate subjects - something like Cracking The Coding Interview in the style of his Learn The Hard way series.
I started with Mark Lutz's Learning Python (http://shop.oreilly.com/product/9780596513986.do) about 10 years ago. In the meanwhile I've been an active contributor to large Python-based open source projects, e.g., Salt (https://github.com/saltstack/salt) which not only that it helped me get feedback from people with a tremendous experience, but also reading through the code taught me good practices and many good ways to solve various problems. A few months ago I started reading Luciano Ramalho's Fluent Python (http://shop.oreilly.com/product/0636920032519.do) which is just beautifully written and with a wide variety of topics for a deeper look inside Python internals.
'Idiomatic Python' is also good, but I would suggest that more for a beginner, or for someone transitioning to Python from another language. If you have a colleague who loops through a collection by creating an incrementing their own counter variable, then give them a copy of this book.
If you already use most of python's idioms correctly (e.g. if you've learned programming primarily from resources about python), get 'Powerful Python' to learn more about how things work under the hood, and learn ways to make your code more readable and/or more efficient (for CPU and/or memory).
It points out some limitations of that book, including one specific example (the 'evil robots attacking' part) that bothered me for the same reasons it bothered the article author.