You are lucky in Python, which is easy to read. But, of course, you can write complex and understandable Python code.
Steps:
- Launch the software and learn how to use it and at least read it a little.
- Read though the tests, if any.
- Read the code.
- When you come across a code that you donβt understand, put a debug break there and go through the code looking at what it does.
- If there are no tests or the level of testing is low, write tests to increase test coverage. This is a good way to learn the system.
- Repeat until you feel that you have a vague grip on the code. Vague clutch is all you need if you are going to control the code. When you actually start working with the code, you will get a good grip. For a large system that can take years, so do not try to understand it first.
There are tools that can help you. As Stephen S says, the IDE is a good idea. I will explain why:
Many editors analyze code. This usually gives you code completion, but more importantly in this case, it just allows you to simply click on a variable to see where it came from. It really speeds things up when you want to understand the otehr people code.
In addition, you need to examine the debugger. You, in complex parts of the code, must go through them in the debugger to see what the code actually does. Python pdb works, but many IDEs have built-in debuggers to make debugging easier.
What is it. Good luck.
Lennart Regebro
source share