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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyPrintShape-0.1.1.tar.gz
.
File metadata
- Download URL: pyPrintShape-0.1.1.tar.gz
- Upload date:
- Size: 4.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbba3d33a0148ddd03d5090c4fae0b679eda2918bfa9bf3e3fff977567120eaa |
|
MD5 | 710e04a9823965010608e334f738a2ff |
|
BLAKE2b-256 | bc0db01e08fce37b2fa084c52de4a1e0a0f97391a53c348952d7f806b85f1b40 |
File details
Details for the file pyPrintShape-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: pyPrintShape-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c34a80d504461caa661f6323d0aae46901c93d9ebe731631181c81304c857bdc |
|
MD5 | 5b2a4bcf17fc2afb841ffecdfd41636b |
|
BLAKE2b-256 | 685b9b778a162bf63289f25b3e5175e12d988542520b8bacd73372f8fd7ed4b2 |