import os
dir_path = os.path.dirname(os.path.realpath(__file__))
import os
#full path
dir_path = os.path.dirname(os.path.realpath(__file__))
#current dir
cwd = os.getcwd()
import os
print(os.path.abspath(''))
from os import getcwd # only import "getcwd" from os
getcwd() # Get the current working directory
import os
your_file_path = "D:yourdirpathfile.csv"
print(f"Dir:{os.path.dirname(your_file_path)}")
#>>> Dir:D:yourdirpath
import os.path
from os import path
def main():
print ("Is it File?" + str(path.isfile('guru99.txt')))
print ("Is it File?" + str(path.isfile('myDirectory')))
if __name__== "__main__":
main()