title: Set files to ownership of current directory in Python
body: <p>I'm working on a Python script that creates text files containing size/space information about the directories that the script is run on. The script needs to be run as root, and as a result, it sets the text files that it creates to root's ownership.</p>
  
  <p>I know I can change the ownership with os.fchown, but how do I pass fchown the uid and gid of the directory that the script is running on?</p>