code: def add_note(path, filename="note.txt"):
      
      path = os.path.expanduser(path)
      assert os.path.isdir(path), "{} is not a valid directory.".format(path)
  
      filepath = os.path.join(path, filename)
      exists = os.path.isfile(filepath)
  
      try:
          subprocess.call([EDITOR, filepath])
      except Exception as exc:
          logger.error("Editing note failed!")
          raise exc
      if exists:
          print("Note updated at:", filepath)
      else:
          print("Note created at:", filepath)
docs: Opens a txt file at the given path where user can add and save notes.
  
      Args:
          path (str): Directory where note will be saved.
          filename (str): Name of note. Defaults to "note.txt"