get_path_temp()

Retrieves the full path to a file or directory located within the system's temporary directory.

An optional relative path (or filename) can be provided, which is appended to the base temporary directory path.

Syntax

planetcnc.get_path_temp()
planetcnc.get_path_temp(str)

Parameters

Parameter Type Description
str string A string representing a relative subpath or filename.

Return Value

Examples

#! /usr/bin/env python 
 
import planetcnc
 
# Get the full path for "tempfile.txt" within the system temporary directory.
temp_file_path = planetcnc.get_path_temp("tempfile.txt")
print("Temporary file path:", temp_file_path)
 
# Get the temporary directory path itself.
temp_dir = planetcnc.get_path_temp()
print("Temporary directory:", temp_dir)

See also

get_path
get_path_exe
get_path_profile
get_path_temp
get_path_working