Beispiel #1
0
def areacalculate():
    if var.get() == "Square":
        a = int(square_entry.get())
        arearesult(mymath.area_square(a))
        canSq.create_rectangle(30, 30, 270, 270, outline="#fb0", fill="#fb0")
        canSq.pack()
        sqLabel.pack()
    elif var.get() == "Circle":
        r = int(circle_entry.get())
        arearesult(mymath.area_circle(r))
        create_circle(150, 150, 5, canCi)
        canCi.pack()
        #canCi.create_oval(150,)
        ciLabel.pack()
    elif var.get() == "Rectangle":
        b = int(rectangle_entry1.get())
        h = int(rectangle_entry2.get())
        arearesult(mymath.area_rectangle(b, h))
    elif var.get() == "Cuboid":
        l = int(cuboid_entry1.get())
        b = int(cuboid_entry2.get())
        h = int(cuboid_entry3.get())
        arearesult(mymath.surface_area_cuboid(l, b, h))
    elif var.get() == "Sphere":
        r = int(sphere_entry.get())
        arearesult(mymath.surface_area_sphere(r))
    elif var.get() == "Cone":
        r = int(cone_entry1.get())
        sl = int(cone_entry2.get())
        arearesult(mymath.surface_area_cone(r, sl))
    elif var.get() == "Cylinder":
        r = int(cylinder_entry1.get())
        h = int(cylinder_entry2.get())
        arearesult(mymath.surface_area_cylinder(r, h))
Beispiel #2
0
import sys
import mymath

# sys.path.append('/cafe24/PycharmProjects/python-modules')
# sys.path.append('../python-modules')

print(mymath.pi)
print(mymath.add(10, 20))
print(mymath.area_circle(10))
import sys
# sys.path.append('/bigdata/PycharmProjects/python_modules')

import mymath

# print(sys.path)
print(mymath.add(10, 20))
print(mymath.area_circle(4))