0

Knowing the name of my folder "folder_name",

how can i easily get in python (script not in the same folder) the absolute path "/home/user/../path/to/../folder_name" ?

Henry8
  • 110
  • 12

1 Answers1

0
import os

directory = os.path.dirname(__file__)
file_path = os.path.join(directory, './filename.extension')
print(file_path)
Arghya Sadhu
  • 41,002
  • 9
  • 78
  • 107
nick
  • 346
  • 2
  • 4