The steady path to Python mastery

Learn Python with spaced repetition and boost your productivity






    all time

    Try it

    Are you ready to master Python?

    Join the waitlist and we'll you when Python cards goes live.

    What are pathlib pure paths?

    Pure paths allow you to manipulate paths without any input/output operation.

    In which two main scenarios are PurePaths useful?

    They are useful:

    • To manipulate Windows paths on a Unix machine or vice versa.
    • To make sure that your code manipulates paths without actually accessing the OS.

    What path does a PureWindowsPath point to if it is instantiated without any parameter?

    What is the output of the following code?

    >>> from pathlib import PureWindowsPath
    >>> PureWindowsPath()

    It points to the current working directory.

    What happens if you try to instantiate a WindowsPath on a Unix-based machine?

    >>> from pathlib import WindowsPath
    >>> WindowsPath()
    Traceback (most recent call last):                                  
      File "<stdin>", line 1, in <module>                               
      File "/usr/lib/python3.8/", line 1044, in __new__       
        raise NotImplementedError("cannot instantiate %r on your system"
    NotImplementedError: cannot instantiate 'WindowsPath' on your system

    It doesn't work, it raises a NotImplementedError exception.

    You cannot use concrete paths for the wrong OS.

    The same thing happens if you try to use PosixPath on a Windows machine.


    What is the / operator called? For example in:

    from pathlib import Path
    Path("directory") / "file.txt"

    It's called the slash operator. It allows you to join paths.

    How can you access the different components of a Path?

    >>> from pathlib import Path
    >>> path = Path("/home/user/file.txt")
    >>> print(
    ('/', 'home', 'user', 'file.txt')

    How do you get the last path component of a path?

    >>> PurePosixPath("/home/user/file.txt").name


    What does POSIX mean?

    POSIX stands for Portable Operating System Interface, it is a family of standards that defines system and user-level APIs, command line shells, and utility interfaces for software compatible with variants of Unix.

    Operating systems such as Linux, MacOS and FreeBSD are POSICX compliant.

    How do you get the file extension of the final component of the path?

    >>> PurePosixPath("my/library/").suffix

    Using PurePath.suffix.

    How can you represent a Windows path with forward slashes?

    >>> from pathlib import PureWindowsPath
    >>> p = PureWindowsPath('c:\\windows')
    >>> 'c:/windows'

    The decks

    A Tour of the Standard Library (0 cards)

    The Python standard library is big, but how big is it? Did you know you can do low-level network communications with socket? And measure the execution time of code with timeit? Have you ever analyzed the syntax tree of a Python code with ast or drawn a plot with turtle? It even has a full sqlite3 implementation!

    Get a grasp of all the functionality just one import away.

    pathlib in depth (139 cards)

    The pathlib library offers the most convenient way of managing files and file paths in Python. Learn its full power and master its API.

    F-strings like a pro
    Coming soon

    Coming soon

    Peter Norvig's pytude tricks
    Coming soon

    If you have ever read Peter Norvig's code from his pytudes, you will agree that his code is odd, surprisingly clear and insultingly concise.

    In this deck, we have collected dozens of tricks in Pytudes so you can come closer to his genius.

    Coming soon

    Learn the concepts and words of Python: type hints, context managers, methods, comprehensions, generic functions…

    Knowing the words is a first step towards a complete mental model of Python.

    Coming soon

    Built-in functions are always available in Python without needing to import them. We are talking about print, range, enumerate, but also isinstance, map and staticmethod.

    The list is short, but holds huge power.

    Built-in exceptions
    Coming soon

    It's easy

    Get daily reminders and build the habit of reviewing your cards.

    It's fun

    Keep your streak and learn bit by bit.

    It works

    Feel your knowledge growing and be amazed by your progress.

    Our secret sauce: the cards

    Built in public

    Check my Youtube channel to see how the site and the decks are built.

    Join the waitlist

    Be the first to know when is ready.

      Frequently Asked Questions

      Can you really learn Python without writing code?

      Of course not. is not a replacement for coding, it's a shortcut to level up your Python skills.

      Are you planning to support other languages?

      Yes. I'm working on, following the same philosophy as

      What spaced repetition algorithm does use?

      We use the classic Anki algorithm, which is a modified version of SM-2. We have actually open sourced our implementation of the algorithm as the Python module simple-spaced-repetition. You can find the code on Github.