pywinauto.linux.application

Implementation of Application class for Linux platform.

class pywinauto.linux.application.Application(backend='atspi', allow_magic_lookup=True)

Bases: pywinauto.base_application.BaseApplication

connect(**kwargs)

Connect to an already running process

The action is performed according to only one of parameters

Parameters:
  • pid – a process ID of the target
  • path – a path used to launch the target

See also

pywinauto.findwindows.find_elements() - the keyword arguments that are also can be used instead of pid or path

cpu_usage(interval=None)

Return CPU usage percent during specified number of seconds

is_process_running()

Checks that process is running.

Can be called before start/connect.

Returns True if process is running otherwise - False

kill(soft=False)

Try to close and kill the application

Dialogs may pop up asking to save data - but the application will be killed anyway - you will not be able to click the buttons. This should only be used when it is OK to kill the process like you would do in task manager.

start(cmd_line, timeout=None, retry_interval=None, create_new_console=False, wait_for_idle=True, work_dir=None)

Start the application as specified by cmd_line

pywinauto.linux.application.assert_valid_process(process_id)