/trunk/Examples/python/simple/runme.py

# · Python · 30 lines · 8 code · 16 blank · 6 comment · 0 complexity · 18421f8560a150398e5ecf12602679d3 MD5 · raw file

  1. # file: runme.py
  2. import example
  3. # Call our gcd() function
  4. x = 42
  5. y = 105
  6. g = example.gcd(x,y)
  7. print "The gcd of %d and %d is %d" % (x,y,g)
  8. # Manipulate the Foo global variable
  9. # Output its current value
  10. print "Foo = ", example.cvar.Foo
  11. # Change its value
  12. example.cvar.Foo = 3.1415926
  13. # See if the change took effect
  14. print "Foo = ", example.cvar.Foo