<human>:  Can you show me a Python program to get parent directory name.
<bot>: Here is a Python program to get parent directory name

import os

def getparent(path):
  """
  Get the parent directory name.
  """
  return os.path.dirname(path)

# Enter the path
path = "/home/rosey/Desktop/test.py"

# Calling the function
print((getparent(path)))

#Example Output
# /home/rosey/Desktop

#Remember to inspect code for bugs.