Exemplo n.º 1
0
def main():
    print('START')
    # print(dir(rect))
    rec = rect.PyRectangle(1, 2, 3, 4)
    try:
        rec_area = rec.get_area()
        print(rec_area)
    finally:
        del rec
Exemplo n.º 2
0
import rect

if __name__ == '__main__':
    pyRect = rect.PyRectangle(100, 100, 300, 500)
    width, height = pyRect.get_size()
    print("Area: width(%d) x height(%d) = %d" %
          (width, height, width * height))
Exemplo n.º 3
0
# -*- coding: utf-8 -*-
"""
Created on Tue Oct  9 19:26:34 2018

@author: bdebaque
"""

# %%
import rect
x0, y0, x1, y1 = 1, 2, 3, 4
rect_obj = rect.PyRectangle(x0, y0, x1, y1)
print((rect_obj.get_area()))
Exemplo n.º 4
0
import rect

if __name__ == '__main__':
    rect = rect.PyRectangle(0, 0, 2, 2)
    area = rect.get_area()
    assert(area == 4)
    print('rectangle: (0, 0, 2, 2), area: {}'.format(area))
Exemplo n.º 5
0
import rect

print(rect.__pyx_capi__)
# {'foo': <capsule object "int (int)" at 0x7f28e02f27e0>,
#  'getArea': <capsule object "int (shapes::Rectangle)" at 0x7f28e02f2c90>,
#  'get_area_cy': <capsule object "int (struct cPyRectangle *)" at 0x7f28e02f2120>}

r = rect.PyRectangle(1, 2, 3, 4)
print(r.__pyx_vtable__)
# <capsule object NULL at 0x7f28e02f2fc0>
Exemplo n.º 6
0
import rect

rect_obj = rect.PyRectangle(1, 2, 3, 4)
rect_obj.get_area()
dir(rect_obj)

print(rect_obj.sumVec([1, 1, 1]))