To create a directory in Python, you can use the mkdir()
function from the os
module. Here is the code snippet to create a directory:
main.py125 chars8 lines
In the above code, os.mkdir(directory)
creates a directory with name example_directory
. You can replace the value of the directory
variable with the name of the directory you want to create.
gistlibby LogSnag