def get_temp_dir(self): if os.name == 'posix': return '/tmp' elif os.name == 'nt': import tempfile return tempfile.gettempdir() else: raise Exception("Unknown operating system [%s]" % os.name)