/trunk/Examples/contract/simple_cxx/runme1.py
Python | 33 lines | 20 code | 9 blank | 4 comment | 0 complexity | 59de2b188a833f957a9b3850562ae6cd MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- import example
- # Create the Circle object
- r = 2;
- print " Creating circle (radium: %d) :" % r
- c = example.Circle(r)
- # Set the location of the object
- c.x = 20
- c.y = 30
- print " Here is its current position:"
- print " Circle = (%f, %f)" % (c.x,c.y)
- # ----- Call some methods -----
- print "\n Here are some properties of the Circle:"
- print " area = ", c.area()
- print " perimeter = ", c.perimeter()
- dx = 1;
- dy = 1;
- print " Moving with (%d, %d)..." % (dx, dy)
- c.move(dx, dy)
- del c
- print "==================================="
- # test construction */
- r = -1;
- print " Creating circle (radium: %d) :" % r
- c = example.Circle(r)