I'm doing a program that uses a temporary file to save a serialized (pickled) object. Currently, the program is generating in /tmp
, but this path is specific to Unix / Linux; wanted to take the path of the default operating system temporary directory that the program will run.
In Java, I know you can do with System.getProperty("java.io.tmpdir")
.
What's the equivalent way of doing this in Python?