# Executing Python with Web Remote Control

**URL:** <https://forums.unrealengine.com/t/executing-python-with-web-remote-control/156550>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [January 18, 2021, 9:31pm UTC](https://forums.unrealengine.com/t/executing-python-with-web-remote-control/156550 "2021-01-18T21:31:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_92f4c823](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_92f4c823](https://forums.unrealengine.com/u/anonymous_user_92f4c823)\
**Post date:** [January 18, 2021, 9:31pm UTC](https://forums.unrealengine.com/t/executing-python-with-web-remote-control/156550/1 "2021-01-18T21:31:36Z")

</div>

Hi all!

I’m attempting to create a remote instance of Unreal that will be able to able to use HighResScreenshot (or Pythons equivalent command) or render sequences. I’ve tried running a Python server directly in Unreal and while seems to be able to run the server it crashes the the rest of Unreal (even if I use multithreading to put the server in it’s own thread). Now I’m trying to achieve this through the [Web Remote Control](https://docs.unrealengine.com/en-US/ProductionPipelines/ScriptingAndAutomation/WebControl/index.html) plugin. I can get this running no problem but can’t wrap my head around the the documentation for executing Python.

It says:

> [@](#):
>
> The Remote Control API offers a similar level of control over the Unreal Editor and the Project Content to what you have when working in Blueprint and Python.
> 
> - Your web application can call any function that is exposed to Blueprint and Python.

And then in the [API HTTP](https://docs.unrealengine.com/en-US/ProductionPipelines/ScriptingAndAutomation/WebControl/Endpoints/index.html) reference it says:

> [@](#):
>
> To remotely call custom [Blueprint Function Libraries](https://docs.unrealengine.com/en-US/Programming/BlueprintFunctionLibraries/index.html) with static methods, the object path must point to the [Class Default Object (CDO)](https://docs.unrealengine.com/en-US/Programming/UnrealArchitecture/Objects/index.html) , which is the one object that a UCLASS maintains. The following sections explain how to build the object path for C++ and Python objects.
> 
> The object path to a CDO in Python follows the format:
> 
> ```auto
> 
> /Engine/PythonTypes.Default__ClassName
> 
> ```
> 
> ClassName is the name of the class, which has a @unreal.uclass() decorator.

Anyone smarter than me able to help me parse this or provide guidance on how they’d tackle setting up a system that can take remote renders on an EC2 instance.

Thanks!

---

<div class="post-metadata">

**Author:** ![Fidilip](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fidilip](https://forums.unrealengine.com/u/Fidilip)\
**Post date:** [November 18, 2021, 12:27pm UTC](https://forums.unrealengine.com/t/executing-python-with-web-remote-control/156550/2 "2021-11-18T12:27:16Z")

</div>

Hello Alex!

Having a Python file `\Project\Content\Python\remote.py`:

```auto
import unreal

@unreal.uclass()
class RemoteClass(unreal.BlueprintFunctionLibrary):
    
    @unreal.ufunction(static=True)
    def remote():
        print("Hello from remote!")

```

You can send PUT request with a body:

```auto
{
	"objectPath": "/Engine/PythonTypes.Default__RemoteClass",
	"functionName": "remote"
}

```

After “installing” the class into the Engine by entering command: `py remote.py` (in Output window). The result is text “Hello from remote!” logged into Output window.

---

<div class="post-metadata">

**Author:** ![ProfessorCowboy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/professorcowboy/32/974428_2.png) [@ProfessorCowboy](https://forums.unrealengine.com/u/ProfessorCowboy)\
**Post date:** [December 12, 2021, 11:25pm UTC](https://forums.unrealengine.com/t/executing-python-with-web-remote-control/156550/3 "2021-12-12T23:25:24Z")

</div>

Hey Fidilip, thanks for the input on this one!

I implemented this code for a basic functions test, and hit a few snags that could prove useful to others coming after us, so I decided to stop lurking and starting throwing out observations.

Your code answered an important question for what the Python is supposed to look like, but my super new self couldn’t figure out what sort of http request to make (aside from a PUT request).

You’re going to want to run it like this, assuming you’re using default ports:  
`http://localhost:30010/remote/object/call`

This, along with the JSON payload described above should have you up and running in no time. After that, you’ll need to figure out how to capture renders and ship them off for consumption elsewhere.

---

<div class="post-metadata">

**Author:** ![9Evgeny9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@9Evgeny9](https://forums.unrealengine.com/u/9Evgeny9)\
**Post date:** [September 19, 2023, 2:47pm UTC](https://forums.unrealengine.com/t/executing-python-with-web-remote-control/156550/4 "2023-09-19T14:47:05Z")

</div>

And how to pass parameter to called function?  
i.e. string parameter
