Live data from Hacker News

Ask HN: How to learn about path configuration in Python

news.ycombinator.com

1–3 of 3 posts

Re: Ask HN: How to learn about path configuration in Python

#3
Whenever setting up a path configuration in my python applications, I always use following at the beginning:

  import os
  os.path.dirname(os.path.abspath(__file__))
This will make sure that absolute path is taken for your file irrespective of the OS and solve the issue of file system when building multi-platform applications.