Hello fellow HN users,<p>I expect to start a job soon where the main backend language is Python, with parts of Ruby and RoR in the stack. I have been a Ruby dev and have a beginner-level familiarity with Python - having read more than written.<p>How should I go about increasing my competency in the language to a decent level as fast as possible. I am talking about general fluency and knowledge about Python and not specific to the tech stack of the company.<p>I am sure there are excellent Python devs here and also devs who had to ramp up on the language for their job. As such, I thought I should get some guidance from the community.<p>Appreciate all opinions and pointers!
* Python Distilled by Dave Beazley - "this concise handbook focuses on the essential core of the language, with updated code examples to illuminate how Python works and how to structure programs that can be more easily explained, tested, and debugged"<p>* Fluent Python by Luciano Ramalho — "takes you through Python’s core language features and libraries, and shows you how to make your code shorter, faster, and more readable at the same time"<p>I have more such Python resources here: <a href="https://learnbyexample.github.io/py_resources/intermediate.html" rel="nofollow">https://learnbyexample.github.io/py_resources/intermediate.h...</a>
Python the hard way would be good, but what do you want/need to do in the job, you might want to mention that! If you are doing webdev you should devote sometime to django/flask. I'm sure you can pick it up pretty quickly, it's less "weird" than ruby but I think most of your time might be getting up to speed on libraries.
I find REPLs and IDEs a great way for learning the libraries and APIs by exploration.<p>Install iPython (the command line, not the notebook interface. The CLI is simpler). Install the libraries you will work with in your new software stack. Read the manuals, do the "hello worlds". Then type some variable and a question mark afterwords. This will show the documentation. Two question marks show the actual code of a particular function in question. This is great for digging around in the libraries. Many IDEs such as PyCharm have similar options when you have code and can navigate all the way down the rabbit hole in the libraries.<p>For many libraries in python, this attemp is not so useful. For instance, numpy delegates much work to actual C code and a lot of magic is involved.<p>Generally, Python has rather few specific syntax, compared to other languages. The language is rather small and you will spend more time on the libraries then on learning the actual language.
I've been really enjoying <a href="https://www.youtube.com/c/ArjanCodes" rel="nofollow">https://www.youtube.com/c/ArjanCodes</a> and frequently watch one over my lunch break.<p>He covers a lot of programming principles and good practice with realistic examples (i.e. _not_ "class Animal")
Take a look at the most voted Python questions on StackOverflow.
<a href="https://stackoverflow.com/questions/tagged/python?sort=MostVotes&edited=true" rel="nofollow">https://stackoverflow.com/questions/tagged/python?sort=MostV...</a>
I think it has always been the case that practice makes perfect. If you want to be good at it, use it, start writing some personal projects, read source code of popular projects using python, learn best practices during the process and correcting yourself along the way.
Python the hard way: <a href="https://shop.learncodethehardway.org/" rel="nofollow">https://shop.learncodethehardway.org/</a><p>Something about writing out each example made it stick like nothing else.
I have this ebook on github [1] which I use to teach Python to my CS 2nd year students. It is quite short on information and has lots of exercises for them to practice and get up to speed with the language, fast.<p>[1] <a href="https://github.com/joaoventura/full-speed-python/" rel="nofollow">https://github.com/joaoventura/full-speed-python/</a>
There's some nice information/ideas on this stackoverflow post on how to develop your python knowledge<p><a href="https://stackoverflow.com/questions/2573135/python-progression-path-from-apprentice-to-guru" rel="nofollow">https://stackoverflow.com/questions/2573135/python-progressi...</a>
Similar situation to me about a year ago. I knew it would take me time to learn the quirks but if your new employer is happy for you to learn python then that is great.<p>The best way to learn is by doing.<p>Maybe play around with making a web or cli based tool between now and your start date.<p>Get familiar writing code in a good IDE
If you want to be a good writer, read a lot of books.<p>You want to be a good python programmer, read other peoples code. Lots of it. Clone some big python projects and try to make changes. Get a feel for what is possible and look for common patterns in implementation.<p>You will always run into that classic mastery curve where initial success leads you to a false sense of mastery, before crashing hard and starting the actual climb to mastery. Get it over with as soon as you can by getting feedback on your early code, and don't take criticism personally.