Answers for "write directory in python"

1

How to Create a Directory in Python?

# Python program to create directory using os.makedirs() method

import os

# Directory path
dir_path = "C:/Projects/Tryouts/test/sample/mydir"
os.makedirs(dir_path)
print("Directory '% s' created" % dir_path)


# Directory path
dir_path2 = "C:/Projects/Tryouts/test/sample/mydir2"
# mode
mode = 0o666
os.makedirs(dir_path2, mode)
print("Directory '% s' created" % dir_path2)
Posted by: Guest on September-25-2021
1

make directory with os python

yamete kudasai
Posted by: Guest on August-08-2021

Code answers related to "write directory in python"

Python Answers by Framework

Browse Popular Code Answers by Language