Python absolute path of file, dirname, join

Python absolute path of file, dirname, join

import os
print(__file__)
print(os.path.abspath(__file__))
print(os.path.dirname(__file__))
print(os.path.dirname(os.path.abspath(__file__)))
print(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
print(os.path.join(BASE_DIR,"templates"))

 

python absolute path join dirname

Tony BB
 

TonyBB is a Coach , marketer, hypnotist and a founder of RSKVF Production who specializes in providing simple, affordable, and easy to use solutions for Life.

Click Here to Leave a Comment Below 0 comments

Leave a Reply: