PageRenderTime 40ms CodeModel.GetById 14ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. import example
  2. # Create the Circle object
  3. r = 2;
  4. print " Creating circle (radium: %d) :" % r
  5. c = example.Circle(r)
  6. # Set the location of the object
  7. c.x = 20
  8. c.y = 30
  9. print " Here is its current position:"
  10. print " Circle = (%f, %f)" % (c.x,c.y)
  11. # ----- Call some methods -----
  12. print "\n Here are some properties of the Circle:"
  13. print " area = ", c.area()
  14. print " perimeter = ", c.perimeter()
  15. dx = 1;
  16. dy = 1;
  17. print " Moving with (%d, %d)..." % (dx, dy)
  18. c.move(dx, dy)
  19. del c
  20. print "==================================="
  21. # test construction */
  22. r = -1;
  23. print " Creating circle (radium: %d) :" % r
  24. c = example.Circle(r)