---
title: "Connect a Python client to Shogun Live"
canonical: "https://help.vicon.com/space/Shogun110/13076206/Connect%20a%20Python%20client%20to%20Shogun%20Live"
format: markdown
---
This page explains how to connect a Python client to Shogun Live.

> Macro (scroll-only)
> 
> > Macro (toc)

## Create a client and check the connection


    **To connect a Python client to Shogun Live:**


1. Start Shogun Live.
  It is now ready to be interacted with via the Python API.
2. Start Python and begin by importing the Vicon Core API:
  `from vicon_core_api import *`
3. Create a client. In this example, the object is named `shogun_client`:
  `shogun_client = Client('localhost')`
  Where:
  - `shogun_client` is the name of the object, which can be any name you want
  - `localhost`
                can be replaced with an IP address or hostname running Shogun Live.
4. Check that the client is connected:
  `shogun_client.connected`This returns True if connected, and False if not.

## Example: Setting the capture name

In Shogun Live, towards the top of the Capture panel, the default capture name is **Take**.

![image](media://4402b8f5-8cac-4389-860b-35d732b45238)

This example shows how you can change the capture name using the Python API.

1. Import the relevant class for interacting with capture:
  `from shogun_live_api import CaptureServices`
2. Create an object for the capture services. In this example, the object is named `capture`, but you can name it as required.
  It references the object name used for the shogun client that was created:
  `capture = CaptureServices(shogun_client)`
3. Use the `set_capture_name` method to set the capture name to `'MyTake001'`:
  `result = capture.set_capture_name('MyTake001')`
4. Check the return value to make sure that this succeeded:
  In Shogun Live the capture name has changed:

For further information, see:

- The readme file:
  *C:\Program Files\Vicon\ShogunLive1.10\SDK\Python\readme.txt*
- Sample scripts:
  *C:\Program Files\Vicon\ShogunLive1.10\SDK\Python\sample_scripts*

## Explore using Python

Run the Python `dir()` command on objects created, to show the methods that can be called:

For example, `dir(shogun_client)` or `dir(capture)`

![image](media://ad9b5c28-e390-40fb-b7f1-ca69b4553a12)

Run `help()` on specific methods or classes.

For example, `help(capture.set_capture_name)`

![image](media://2b38edcc-b3a6-4f2a-8e3b-6fe8dc3cc120)