Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

PyTextCanvas

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

PyTextCanvas

PyTextCanvas is a module for writing text and ascii art to a 2D string "canvas" in Python.

  • 0.0.3
  • PyPI
  • Socket score

Maintainers
1

============ PyTextCanvas

PyTextCanvas is a module for writing text and ascii art to a 2D string "canvas" in Python.

PyTextCanvas has a Canvas class, which is a data structure for a "2D string", where characters can be "drawn" to the canvas using x, y coordinates. The canvas can be exported as a basic Python string or HTML.

Runs on Windows, macOS, and Linux.

This module could be used in curses-like or urwid-like modules.

Installation

``pip install pytextcanvas``

Example Usage

>>> import pytextcanvas as pytc
>>> canvas = pytc.Canvas(20, 4)
>>> canvas.fill('.')
>>> print(canvas)
....................
....................
....................
....................
>>> canvas.write('Hello, world!')
>>> print(canvas)
Hello, world!.......
....................
....................
....................
>>> canvas.cursor = (10, 2)
>>> canvas.write('Howdy!!!')
>>> print(canvas)
Hello, world!.......
....................
..........Howdy!!!..
....................
>>> str(canvas)
'Hello, world!.......\n....................\n..........Howdy!!!..\n....................'
>>> canvas.rectangle('*', 0, 0, 20, 4)
>>> print(canvas)
********************
*..................*
*.........Howdy!!!.*
********************

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc