code: def _complete_path(path=None):
      
      if not path:
          return _listdir('.')
      dirname, rest = os.path.split(path)
      tmp = dirname if dirname else '.'
      res = [p for p in _listdir(tmp) if p.startswith(rest)]
      # more than one match, or single match which does not exist (typo)
      if len(res) > 1 or not os.path.exists(path):
          return res
      # resolved to a single directory, so return list of files below it
      if os.path.isdir(path):
          return [p for p in _listdir(path)]
      # exact file match terminates this completion
      return [path + ' ']
docs: Perform completion of filesystem path.
      https://stackoverflow.com/questions/5637124/tab-completion-in-pythons-raw-input