Answers for "python get dir of current file"

12

python get current file location

import os
os.path.dirname(os.path.abspath(__file__))
Posted by: Guest on May-11-2020
0

python find directory of file

import os
  
print('File name :    ', os.path.basename(__file__))
print('Directory Name:     ', os.path.dirname(__file__))
Posted by: Guest on January-10-2022

Python Answers by Framework

Browse Popular Code Answers by Language