launch
This function launches the given URL (or filename) in the default
viewer application for this file type. If this is an executable, it
might launch the executable in a new session. The return value is
the exit code of the launched application. Usually, 0 indicates
success.
def launch(
url: str,
wait: bool = False,
locate: bool = False
) - > int
This function launches the given URL (or filename) in the default viewer application for this file type. If this is an executable, it might launch the executable in a new session. The return value is the exit code of the launched application. Usually, 0 indicates success.
Parameters
| Name | Type | Description |
|---|---|---|
| url | str | URL or filename of the thing to launch. |
| wait | bool = False | Wait for the program to exit before returning. This only works if the launched program blocks. In particular, xdg-open on Linux does not block. |
| locate | bool = False | If this is set to True, then instead of launching the application associated with the URL, it will attempt to launch a file manager with the file located. This might have weird effects if the URL does not point to the filesystem. |
Returns
| Type | Description |
|---|---|
int | The exit code of the launched application, where 0 typically indicates success. |