Lazo Lab Sign up

Read Python Like a Pro / Errors and help

Lesson 10 of 10

Reading other people's code

Start with the big picture: what files are there, where does it start (often main() or if __name__ == '__main__'), and what are the main functions? Then zoom into one part at a time.

Key points

  • Find the entry point first
  • Skim function names before details
  • Run it and change one small thing
def load():
    ...

def show(items):
    ...

def main():
    items = load()
    show(items)

if __name__ == "__main__":
    main()

Your turn

Pick a small Python project on GitHub, find its entry point, and write down in one sentence what each main function does.

Watch a video on thisOpens YouTube search results for “Reading other people's code” in a new tab

Quiz · +10 XP

Where does this program start running its real work?

Log in to save progress and earn XP.