Here's a roadmap that i made for a friend of mine.
Learn the Language.
Learn the basics of python and programming. Stuff like variables, conditionals, functions, lists, dicts ,loops, opening and writing files, taking input from a user, running a python file etc. At this stage you should get familiar with the language and get comfortable with writing code.
Understand python style guide and setup a proper environment
Now that you know basic python, understand how python code should be written. Python uses the
PEP8 specification as it's style guide. Setup your ide/editor (i recommend Visual Studio Code) with a language server for autocompletion and a code formatterr like black.
Learn to Handle Errors
This is important phase, don't skip it. Learn how to debug code and how to use a debugger. Learn what exceptions are and how to handle it with
. Learn how to raise exceptions when needed and how to understand tracebacks.
Learn OOP
in python almost everything is an object.learn what they are. Le
arn how to use classes and make objects, use inheritance and other basic oop concepts like polymorphism and composition. Next python oop concepts likew dunder methods and properties.
Modules, Imports and Libraries.
A python file is called a module. You can import classes, functions and variables from one python file to another. Learn how namespaces work, how to use the "import keyword", what packages are. Make a small package yourself and try using it.
Python standard library
python has a huge standard library for doing a lot of stuff. Want to get the current time? There's the time module. Want to compute square root of a number? There's the math module. Want to send an email? There's a smtp module. Get familiar with using a few of them.
Libraries and Frameworks
now that you are comfortable with python syntax, packages and the standard library. Its time to make fun stuff. Python has a huge number of third party libraries and frameworks (learnt packages? These are just packages or collection of packages). You can install them with "pip", pythons package installer tool.
There are several helpful libs for automation you can install. There's PyAutoGui that you can use to automate mouse movements and keyboard presses. Selenium for browser automation and many others.
Further Learning
There's always a lot of stuff to learn. You can learn concurrency, async and threading, there are advanced language features like lambdas, iterators, decorators, generators, pattern matching etc. There's source control like git/github. Just keep learning.
Resources
"So, how am I gonna learn all of this", you ask? Well, I could recommend these 2 books to begin with:
-
Automate the Boring Stuff with python(atbs)
- Beyond the basic stuff with python (btbs)
Both of these are free to read online. I recommend going through atbs first and complete it cover to cover while doing the projects. It will you teach you the basics of python while doing fun projects. Then proceed with btbs either cover to cover or complete the topics mentioned here first.