How to create a new directory using python

Published: 03 May 2020
on channel: Success Learners
908
10

#youtube #youtuber #instagram #music #like #follow #love #youtubers #spotify #video #gaming #subscribe #hiphop #explorepage #youtubechannel #twitch #facebook #tiktok #memes #instagood #gamer #rap #ps #fortnite #soundcloud #k #viral #art #explore #bhfyp


Create a directory in Python
The OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. The os and os.path modules include many functions to interact with the file system. All functions in os module raise OSError in the case of invalid or inaccessible file names and paths, or other arguments that have the correct type but are not accepted by the operating system.

There are different methods available in the OS module for creating a director. These are –

os.mkdir()
os.makedirs()

Using os.mkdir()
os.mkdir() method in Python is used to create a directory named path with the specified numeric mode. This method raise FileExistsError if the directory to be created already exists.


On this page of the site you can watch the video online How to create a new directory using python with a duration of hours minute second in good quality, which was uploaded by the user Success Learners 03 May 2020, share the link with friends and acquaintances, this video has already been watched 908 times on youtube and it was liked by 10 viewers. Enjoy your viewing!