PageRenderTime 23ms CodeModel.GetById 17ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Examples/contract/simple_cxx/runme1.py

#
Python | 33 lines | 20 code | 9 blank | 4 comment | 0 complexity | 59de2b188a833f957a9b3850562ae6cd MD5 | raw file
 1import example 
 2
 3# Create the Circle object
 4
 5r = 2;
 6print "  Creating circle (radium: %d) :" % r
 7c = example.Circle(r)
 8
 9# Set the location of the object
10
11c.x = 20
12c.y = 30
13print "  Here is its current position:"
14print "    Circle = (%f, %f)" % (c.x,c.y)
15
16# ----- Call some methods -----
17
18print "\n  Here are some properties of the Circle:"
19print "    area      = ", c.area()
20print "    perimeter = ", c.perimeter()
21dx = 1;
22dy = 1;
23print "    Moving with (%d, %d)..." % (dx, dy)
24c.move(dx, dy)
25
26del c
27
28print "==================================="
29
30# test construction */
31r = -1;
32print "  Creating circle (radium: %d) :" % r 
33c = example.Circle(r)