This recipe will show you how to create a directory in MicroPython. We will also show you how to create a function that can be called multiple times with the same path and will only create a directory if the directory doesn't exist yet. Then, we will define a function to behave just like the makedirs function, which is a part of the Python standard library but is not included in MicroPython.
These set of features can be useful whenever you need to create a project that might necessitate the creation a specific directory tree and then populate it with a certain set of files. It also helps to have access to these functions when you are working on a board such as the ESP8266, which will only let you create the directories you need through the REPL and your Python code.