Ejemplo n.º 1
0
def main():
    
    p1 = Point()
    p2 = Point()
    p1.x = 0
    p1.y = 0
    p2.x = 3
    p2.y = 4.5
    print distance_between_points(p1, p2)
    
    lumpy = Lumpy()
    lumpy.make_reference()

    box = Rectangle()
    box.width = 100.0
    box.height = 200.0

    box.corner = Point()
    box.corner.x = 0.0
    box.corner.y = 0.0

    print 'move'
    box2 = move_rectangle2(box, 50, 100)
    print box2.corner.x
    print box2.corner.y

    lumpy.object_diagram()
Ejemplo n.º 2
0
"""This module contains code from
Think Python by Allen B. Downey
http://thinkpython.com

Copyright 2012 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html

"""

from lumpy_demo import *

from swampy.Lumpy import Lumpy

lumpy = Lumpy()
lumpy.make_reference()

cheeses = ['Cheddar', 'Edam', 'Gouda']
numbers = [17, 123]
empty = []

lumpy.object_diagram()
print_diagram(lumpy, 'lumpydemo3.eps')