Skip to content

decorators

execute_in_thread

execute_in_thread(func: Callable = None, *, slot: Callable = None)

Execute a function in a separate thread, usually for functions that do not return a value. For functions that return a value, use the slot parameter to connect the resultReady signal to a function that will receive the result.

PARAMETER DESCRIPTION
func

Function to be executed in a separate thread, by default None

TYPE: Callable DEFAULT: None

slot

Function to be connected to the resultReady signal when the result is ready, by default None

TYPE: Callable DEFAULT: None

get_main_window

get_main_window() -> Optional[MicromechanicalMainWindow]

Return the main window for the application.

timing

timing(func: Callable = None, *, target: Callable[[str], Any] = print)

Print the time taken for a function to execute.

PARAMETER DESCRIPTION
func

Function to be timed, by default None

TYPE: Callable DEFAULT: None

target

Function to print the timing information, by default print

TYPE: Callable[[str], Any] DEFAULT: print