title: Python temporary directory to execute other processes?
body: <p>I have a string of Java source code in Python that I want to compile, execute, and collect the output (stdout and stderr). Unfortunately, as far as I can tell, <code>javac</code> and <code>java</code> require real files, so I have to create a temporary directory.</p>
  
  <p>What is the best way to do this? The tempfile module seems to be oriented towards creating files and directories that are only visible to the Python process. But in this case, I need Java to be able to see them too. However, I also want the other stuff to be handled intelligently if possible (such as deleting the folder when done or using the appropriate system temp folder)</p>