Skip to main content

A cross-platform module for GUI automation for human beings. Control the keyboard and mouse from a Python script.

Project description

A Python module of generators that generate x, y coordinates for various vector shapes such as lines, rectangles, etc. Named after Bresenham of line-algorithm fame.

pip install pybresenham

If you need the x, y coordinates that make up vector shapes such as lines, circles, etc., this module has generators that yield simple (x, y) tuples of the integer points in these shapes. This has applications anywhere you have a 2D grid of discrete points.

For example:

>>> import pybresenham
>>> pybresenham.line(0, 0, 3, 6)
<generator object line at 0x00000000030923B8>
>>> list(pybresenham.line(0, 0, 3, 6))
[(0, 0), (0, 1), (1, 2), (1, 3), (2, 4), (2, 5), (3, 6)]

PyBresenham is currently under development, and is seeking contributors!

The following functions aren’t yet implemented:

  • ellipse()

  • ellipseVertices()

  • arc()

  • arcVertices()

  • star()

  • starVertices()

  • hexGrid()

  • hexGridVertices()

  • hexGridInterior()

  • bezier()

  • bezierVertices()

  • roundedBox()

  • roundedBoxVertices()

The thickness, filled, endcap, and viewport parameters are still unimplemented. (Except for square() and rectangle(), which do implement the filled parameter.)

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

PyBresenham-0.0.4.tar.gz (8.9 kB view hashes)

Uploaded Source

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