# Python RTDE example

**URL:** <https://forum.universal-robots.com/t/python-rtde-example/14536>\
**Category:** URScript\
**Created:** [May 25, 2021, 8:49pm UTC](https://forum.universal-robots.com/t/python-rtde-example/14536 "2021-05-25T20:49:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon59108369](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@anon59108369](https://forum.universal-robots.com/u/anon59108369)\
**Post date:** [May 25, 2021, 8:49pm UTC](https://forum.universal-robots.com/t/python-rtde-example/14536/1 "2021-05-25T20:49:18Z")

</div>

Hi everyone,  
If anyone here is working with RTDE using python and would like to share their URScript as well as code written in Python that would be very helpful.  
I am especially looking for an example of using servoj() or force\_mode() where one has a thread running to operate the robot in RTDE.  
It would be very helpful to see some examples of working programs which I and probably others could use to learn how to work in real-time with the robot.

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![anon59108369](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@anon59108369](https://forum.universal-robots.com/u/anon59108369)\
**Post date:** [May 26, 2021, 5:55pm UTC](https://forum.universal-robots.com/t/python-rtde-example/14536/2 "2021-05-26T17:55:57Z")

</div>

Request still holds 🙂

---

<div class="post-metadata">

**Author:** ![uwe.kindler](https://avatars.discourse-cdn.com/v4/letter/u/58f4c7/32.png) [@uwe.kindler](https://forum.universal-robots.com/u/uwe.kindler)\
**Post date:** [May 31, 2021, 4:47am UTC](https://forum.universal-robots.com/t/python-rtde-example/14536/3 "2021-05-31T04:47:30Z")

</div>

Here is a library with C++ and Python interface that works with RTDE interface:

> **[SDU Robotics / ur\_rtde · GitLab](https://gitlab.com/sdurobotics/ur_rtde)**
>
> A C++ interface for controlling and receiving data from an UR robot using the Real-Time Data Exchange (RTDE) interface of the robot. The interface can also be used...
