Skip to main content

A simple shape printing library

Project description

pyPrintShape

This is a library that lets you easily print various shapes on the terminal using integer digits.
You can print a huge variety of shapes- squares, rectangles, various triangles, diamonds, circles.

You can find the package here

The source code can be found here

Installation

pip install pyPrintShape

Usage

First you need to import the library.

from pyPrintShape import printShape

The following methods can be used for the actual printing-

printShape.square(side, value, spacing)

Print a Square pattern of integer digits.

:param side: The sidelength of square.
:type side: int

:param value:
:type value: int

:param spacing: Number of spaces between characters to make it look like an actual shape (Depends on your font tho, so adjust accordingly)
:type spacing: int

printShape.rectangle( l, b, value, spacing)

Print a Rectangle pattern of integer digits.

:param l: The horizontal side length of Rectangle.
:type l: int

:param b: The vertical side length of Rectangle.
:type b: int

:param value: The integer used to make the pattern
:type value: int

:param spacing: Number of spaces between characters to make it look like an actual shape (Depends on your font tho, so adjust accordingly)
:type spacing: int

printShape.triangle.right.bottom_left( h, b, value,spacing)

Print a right angled triangle pattern of integer digits in the bottom left.

:param h: The height of triangle.
:type h: int

:param b: The base length of triangle.
:type b: int

:param value: The integer used to make the pattern
:type value: int

:param spacing: Number of spaces between characters to make it look like an actual shape (Depends on your font tho, so adjust accordingly)
:type spacing: int

printShape.triangle.right.top_left( h, b, value,spacing)

Print a right angled triangle pattern of integer digits in the top left.

:param h: The height of triangle.
:type h: int

:param b: The base length of triangle.
:type b: int

:param value: The integer used to make the pattern
:type value: int

:param spacing: Number of spaces between characters to make it look like an actual shape (Depends on your font tho, so adjust accordingly)
:type spacing: int

printShape.triangle.right.bottom_right( h, b, value,spacing)

Print a right angled triangle pattern of integer digits in the bottom right.

:param h: The height of triangle.
:type h: int

:param b: The base length of triangle.
:type b: int

:param value: The integer used to make the pattern
:type value: int

:param spacing: Number of spaces between characters to make it look like an actual shape (Depends on your font tho, so adjust accordingly)
:type spacing: int

printShape.triangle.right.top_right( h, b, value,spacing)

Print a right angled triangle pattern of integer digits in the top right.

:param h: The height of triangle.
:type h: int

:param b: The base length of triangle.
:type b: int

:param value: The integer used to make the pattern
:type value: int

:param spacing: Number of spaces between characters to make it look like an actual shape (Depends on your font tho, so adjust accordingly)
:type spacing: int

printShape.diamond(d, value, spacing)

Print a diamond pattern of integer digits.

:param d: The diagonal length of diamond.
:type d: int

:param value: The integer used to make the pattern
:type value: int

:param spacing: Number of spaces between characters to make it look like an actual shape (Depends on your font tho, so adjust accordingly)
:type spacing: int

printShape.circle(radius, value, spacing)

Print a circular pattern of integer digits.

:param radius: The radius of circle.
:type radius: int

:param value: The integer used to make the pattern
:type value: int

:param spacing: Number of spaces between characters to make it look like an actual shape (Depends on your font tho, so adjust accordingly)
:type spacing: int

Change Log

0.1.0

  • First Release

0.1.1

  • Fixing bugs due to wrong indenting

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyPrintShape-0.1.1.tar.gz (4.7 MB view hashes)

Uploaded Source

Built Distribution

pyPrintShape-0.1.1-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page