DEV Community

Cover image for pymetry library
Jahongir Sobirov
Jahongir Sobirov

Posted on

pymetry library

Pymetry

Pymetry easy library into use in Python

How to use in Pymetry

With this python library, you can draw shapes in just one line of code from the turtle module.

Draw square in Pymetry

import pymetry
pym = pymetry
pym.square(100, "orange", 5)
#100 => distance
#"orange" => color line
#5 => line size
Enter fullscreen mode Exit fullscreen mode

Draw triangle in Pymetry

import pymetry
pymetry.triangle(90, 135, 100, "orange", 0)
#90 => corner
#135 => corner
Enter fullscreen mode Exit fullscreen mode

Draw corner in Pymetry

import pymetry
pym = pymetry
pym.corner(20, 100, "black", 2)
#20 => corner
Enter fullscreen mode Exit fullscreen mode

Draw rectangle in Pymetry

import pymetry
pym = pymetry
pym.rect(100, "gray", 7)
Enter fullscreen mode Exit fullscreen mode

Draw circle in Pymetry

import pymetry
pymetry.circle(60, "brown", 4)
Enter fullscreen mode Exit fullscreen mode

Draw pentagon in Pymetry

import pymetry
pym = pymetry
pym.pentagon(150, "yellow", 8)
Enter fullscreen mode Exit fullscreen mode

Draw hexagon in Pymetry

import pymetry
pym = pymetry
pym.hexagon(200, "yellow", 8)
Enter fullscreen mode Exit fullscreen mode

Draw heptagon in Pymetry

import pymetry
pym = pymetry
pym.heptagon(100, "yellow", 8)
Enter fullscreen mode Exit fullscreen mode

Draw octagon in Pymetry

import pymetry
pym = pymetry
pym.octagon(150, "yellow", 8)
Enter fullscreen mode Exit fullscreen mode

Draw polygon in Pymetry

import pymetry
pym = pymetry
pym.polygon("blue", 3)
Enter fullscreen mode Exit fullscreen mode

Turtle shape in Pymetry

import pymetry
pym = pymetry
pym.trsize("1, 20, 15)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)