Answers for "what is the name of directory created by python used"

2

directory name python

# Directory name from path of file
import os
file_name = "/home/ubuntu/Project/demo.txt"
dir_name = os.path.dirname(file_name)
print(dir_name)
Posted by: Guest on March-26-2021

Code answers related to "what is the name of directory created by python used"

Python Answers by Framework

Browse Popular Code Answers by Language