title: Python: differences between tempfile.mkdtemp and tempfile.TemporaryDirectory
body: <p>I need to create a temp directory that will house another named directory and subfiles. In the end the named directory and subfiles will be appended to a tarball and the temp directory can be removed. Was initially going to use <a href="https://docs.python.org/3/library/tempfile.html#tempfile.mkdtemp" rel="nofollow noreferrer"><code>mkdtemp()</code></a> but it looks like the <a href="https://docs.python.org/3/library/tempfile.html#tempfile.TemporaryDirectory" rel="nofollow noreferrer"><code>TemporaryDirectory()</code></a> method removes itself? Can someone explain the differences.</p>