---
title: "Connect a Python client to Shogun Post"
canonical: "https://help.vicon.com/space/ShogunPost121/1253736687/Connect%20a%20Python%20client%20to%20Shogun%20Post"
format: markdown
---
When a Shogun Post Python client object is created it automatically tries to connect to a local instance of Shogun Post over TCP/IP via port 803.

```plaintext
import ViconShogunPost
shogun = ViconShogunPost.ViconShogunPost()
```

To direct the client to a different instance of Shogun Post, specify the appropriate parameters, or re-direct after creation using the Connect() method.

```plaintext
shogun = ViconShogunPost.ViconShogunPost( "192.168.0.0", 804 )
```

You can change the port used by Shogun Post for communication in the **Preferences** dialog box, on the **Misc** tab. The default behavior of Shogun Post is to communicate via port 803, though if multiple instances of Shogun Post are opened on the same machine they will automatically choose different port numbers (searching incrementally upwards). You can specify a fixed port in the **Preferences** dialog box, or from the application command line.

```plaintext
ShogunPost.exe -ControlStreamPort 804
ShogunPostCL.exe -controlStreamPort 804
```

> ✅ **Tip**   
> ✅ If you disconnect your Ethernet cable and disable wifi, when you enter a Python command, the following error may be displayed:  
> ✅ `Host Application is not connected, unable to retrieve command list ` This is because Python connects toShogun Post over TCP/IP and if you are working entirely offline, Python andShogun Post cannot connect.  
> ✅ To solve this issue, install the Microsoft Loopback Adapter. For instructions on how to do this, see [Install the Microsoft Loopback Adapter](#InstallLBAdapter).

> Macro (scroll-pagebreak)

> Macro (anchor)



## Install the Microsoft loopback adapter

**To install the Microsoft loopback adapter on Windows 11:**

1. Right-click the Windows **Start** menu icon and select **Device Manager** (or use your preferred method of opening the Device Manager).
2. In the **Device Manager**, select any item in the **Common hardware types** list.
3. From the **Action** menu, select **Add legacy hardware**.
4. On the welcome screen, click **Next**.
5. In the **Add Hardware** dialog, select **Install the hardware that I manually select from a list** and then click **Next**.
6. In the next dialog, scroll down the **Common hardware types** list, select **Network adapters** and then click **Next**.
7. From the **Manufacturer** list, select **Microsoft**, and then select **Microsoft KM-TEST Loopback Adapter **card model and click **Next**.
8. In the next screen, click **Next**.
9. Click **Finish**.