---
title: "Connect a Python client to Shogun Post"
canonical: "https://help.vicon.com/space/Shogun19/13796845/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 to Shogun 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 *Adding the MS Loopback Adapter on Windows 7*, on [http://blogs.msdn.com](http://blogs.msdn.com)
> ✅ 
> ✅ .