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
  • 120
  • 7

1 Answers1

0
import os

directory = os.path.dirname(__file__)
file_path = os.path.join(directory, './filename.extension')
print(file_path)
Arghya Sadhu
  • 35,183
  • 9
  • 62
  • 80
nick
  • 96
  • 1
  • 2