ctypes struct returned from library
<p>Given a simple C file:</p>

<pre><code>#include &lt;stdio.h&gt;

typedef struct point {
    int x;
    int y;
} POINT; 

POINT get_point() 
{
    POINT p = {1, 2};
    return p;
}
</code></pre>

<p>And I have a simple python file:</p>

<pre><code>from ctypes import *
import os

lib_name = '/testlib.so' 
test_lib = CDLL(os.getcwd() + lib_name)

class POINT(Structure):
    _fields_ = [('x', c_int),
                ('y', c_int)]

# Sets p1 to the integer 1
p1 = test_lib.get_point()
# Sets p2 to the struct POINT with values {1, 0}
p2 = POINT(test_lib.get_point())
</code></pre>

<p>How can I set my returned value to the struct <code>POINT</code> with values <code>{1, 2}</code>? </p>