get_path_exe()

Returns the full path to a file located relative to the executable directory. This function is useful for locating files that reside in the same folder as the application executable.

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

Syntax

planetcnc.get_path_exe()
planetcnc.get_path_exe(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 "Samples" relative to the executable's directory.
samples_path = planetcnc.get_path_exe("Samples")
print("Executable relative path:", samples_path )
 
# Get the executable directory itself.
exe_dir = planetcnc.get_path_exe()
print("Executable directory:", exe_dir)

See also

get_path
get_path_exe
get_path_profile
get_path_temp
get_path_working