# Error converting Python object

**URL:** <https://forum.uipath.com/t/error-converting-python-object/207055>\
**Category:** Studio\
**Tags:** question, python, activities\
**Created:** [March 30, 2020, 9:51am UTC](https://forum.uipath.com/t/error-converting-python-object/207055 "2020-03-30T09:51:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Udhay](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/udhay/32/71814_2.png) [@Udhay](https://forum.uipath.com/u/Udhay)\
**Post date:** [March 30, 2020, 9:51am UTC](https://forum.uipath.com/t/error-converting-python-object/207055/1 "2020-03-30T09:51:52Z")

</div>

Hi,

I am trying to invoke Python code from UiPath.

I use Invoke Python Method, it is successful all the times. But when I use Get Python Object to retrieve the .net datatype, System.InvalidOperationException occurs.

I can succesfully get String, Double values. But the Get Python object fails when I try to return Tuple(Double) or List(Double) from Python. I use Tuple(Double) and List(Double) in the TypeArgument option in the Get Python Object.

Kindly let me know how to retrieve Tuple and List from Python to UiPath.

Cheers! 🙂

---

<div class="post-metadata">

**Author:** ![sharmah5](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@sharmah5](https://forum.uipath.com/u/sharmah5)\
**Post date:** [May 6, 2020, 6:16pm UTC](https://forum.uipath.com/t/error-converting-python-object/207055/3 "2020-05-06T18:16:09Z")

</div>

@Udhay You should try converting the python object to type Array, of which elements are of type Object. Then you can further process/cast the items downstream, as necessary.

Best,  
Hari

---

<div class="post-metadata">

**Author:** ![chaitanya.kulkarni](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/chaitanya.kulkarni/32/464045_2.png) [@chaitanya.kulkarni](https://forum.uipath.com/u/chaitanya.kulkarni)\
**Post date:** [June 9, 2021, 1:25pm UTC](https://forum.uipath.com/t/error-converting-python-object/207055/4 "2021-06-09T13:25:01Z")

</div>

Hello,

What I did was, I converted python output in a string format.

return str(output)

It worked for me. 🙂

Hope this helps!

---

<div class="post-metadata">

**Author:** ![li\_Charlie](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/li_charlie/32/229813_2.png) [@li\_Charlie](https://forum.uipath.com/u/li_Charlie)\
**Post date:** [June 13, 2022, 8:32am UTC](https://forum.uipath.com/t/error-converting-python-object/207055/5 "2022-06-13T08:32:30Z")

</div>

if I want to return a list in python, but it not works well in Uipath  
so I did this:

I add `s = "-".join(list1)` to return a string actually in python code,  
and in Uipath I use for each, the in ares I input `result.split("-"c)` to print the list item I want.

hope this hepls
