> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/scopeview/automation-api-and-scripting/use-python-scopeview-api/python-api-reference/general.md).

# General

## Function: close

| **Section**    | **Description**                           |
| -------------- | ----------------------------------------- |
| **Action**     | Close ScopeView                           |
| **Parameters** | None                                      |
| **Returns**    | Error value (int)                         |
| **Raises**     | **Exception** – Raises exception on error |

## Function: connectToScopeViewRemote

| **Section**    | **Description**                                                                                                                                                                 |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Action**     | Connect to the first instance of ScopeView                                                                                                                                      |
| **Parameters** | <p><strong>id</strong> (<em>str or int or None</em>) – The unique identifier for the remote ScopeView<br><strong>timeout</strong> (<em>int</em>) – Timeout in milliseconds.</p> |
| **Returns**    | Result of the connection to the selected service.                                                                                                                               |
| **Raises**     | **Exception** – If connection fails.                                                                                                                                            |

## Function: disableScopeViewApiExceptions

| **Section**    | **Description**                                                         |
| -------------- | ----------------------------------------------------------------------- |
| **Action**     | Disable ScopeViewApi from returning ScopeView exceptions through Python |
| **Parameters** | None                                                                    |
| **Returns**    | None                                                                    |
| **Raises**     | None                                                                    |

## Function: openScopeView

| **Section**    | **Description**                                                                    |
| -------------- | ---------------------------------------------------------------------------------- |
| **Action**     | Opens ScopeView and connects to it. If no instance is running, launches a new one. |
| **Parameters** | **timeout** (*int*) – Timeout in milliseconds                                      |
| **Returns**    | PID of the connected or newly launched ScopeView instance. (int)                   |
| **Raises**     | None                                                                               |

{% hint style="info" %}
When using HYPERSIM, or when forceUseHypersimDir is set to True with setEnv(), the ScopeView location is relative to the HYPERSIM\_DIR variable. Otherwise, the ScopeView location is relative to the Scopeview API location.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/scopeview/automation-api-and-scripting/use-python-scopeview-api/python-api-reference/general.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
