Other Things

Additional Resources

More places to find information.

Real World Python Applications

What’s Python good for?

For real world examples of Python development see the awesome Python applications list.

For handy third-party libraries to use in Python, check out the Python awesome list.

Useful Standard Library Modules

Some very commonly used standard library modules:

  • sys

  • math

  • datetime

  • re

  • pathlib

  • collections

  • itertools

  • functools

  • json

  • urllib (or third-party requests)

  • subprocess

Doug Hellman’s Python Module of the Week has a great overview of many standard library modules.

Troubleshooting Tips

Code now working and you’re not sure why?

Here are some tips that might help.

Introspect

Try to read and understand tracebacks (read them from the bottom upward).

Either debug by printing or, when more investigation is needed, use a debugger, such as PDB.

Introspect Python objects with type(), help(), dir() and vars().

Use the scientific method

Fight confirmation bias, scientific method-style.

If you’re thinking “how could this be possible… this makes no sense”, you are likely making some assumptions which are not matched up with reality. You need to try disproving your assumptions, one-by-one.

Narrow down where the issue might be in your code by:

  • Adding a breakpoint or a print call or adding a runtime bug in a specific section of code to see if that bit of code is even being executed

  • Add an if statement and a breakpoint to check whether a specific condition is ever being met

  • Is the issue with your code, someone else’s code, other tooling or configurations, or in your data? You may be assuming the issue is with your code, but it might not be the code.

Troubleshooting is a learned skill and there are layers to the skill. Write down what you’ve tried so far.

Seek help

Talk to a rubber duck, talk to an LLM, like Claude or Chat GPT, or talk to a coworker to second guess your reasoning. Talking through problems, even with a robot or an inanimate object can help.

Take your mind off the problem for a few minutes. Try taking a walk or meditating.