nicklasos
10/29/2014 - 3:23 PM

python

python

# Full path to file
os.path.join(os.path.dirname(os.path.realpath(__file__)), 'backups', 'file.zip')


def full_path(*args):
  """ full_path('dir', 'folder', 'file.txt') """
  return os.path.join(os.path.dirname(os.path.realpath(__file__)), *args)


def full_path(filepath, *args):
  """ full_path(__file__, 'dir', 'folder', 'file.txt') """
  return os.path.join(os.path.dirname(os.path.realpath(filepath)), *args)