Skip to main content

A small module allowing to link the kandinsky module, from the Numworks, to a window.

Project description

Visitor Badge Downloads pip

Kandinsky-Numworks

This module depend to PySDL2 module and sdl2 libraries, PySDL2 is just an sdl2 wrapper with ctype and it just call methods in sdl2 library. To install both modules, click here and follow steps.

This module allowing to link the kandinsky module, from the Numworks, to a window. Useful if you want to test your program without putting it on the calculator.
In addition, this module also emulates the drawing speed, and has many other features.

Installation

You now have the option to install this module on pypi.org. For that, follow the steps here.

More

I also recreated the ion module of the Numworks, check it out here: Ion module of Numworks
If you have a question, check out the FAQ. And if you have a suggestion or your question is not answered, open an Issue.

Usable content

get_pixel():

  • Parameters: x, y
  • Description: Return pixel (x, y) color

set_pixel():

  • Parameters: x, y, color
  • Description: Color pixel (x, y)

color():

  • Parameters: r, g, b
  • Description: Define a rgb color

draw_string():

  • Parameters: text, x, y, color [default: (0,0,0)], background [default: (248,252,248)]
  • Description: Display a text from pixel (x, y)

fill_rect():

  • Parameters: x, y, width, height, color
  • Description: Fill a rectangle at pixel (x, y)

quit():

  • Parameters: No parameters
  • Description: Close manualy the window without notifying the user
  • Note: after that you cannot reopen the window, so a re-import of kandinsky will be required to get a new window.

Additional features

A GUI to control library

  • Pause/resume: You can pause/resume your script
    Note: This will just pause the calls of kandinsky. So for the script to pause, it must be called one of the functions of the library

  • Screenshot: You can also take a screenshot of screen
    Note: This take just the numworks interface and drawable area, not the GUI

  • Change OS: Change the speed of execution. You have chose of Numworks, Omega, Upsilon, and PC mode
    Note: Only work for kandinsky methods

  • Change model: Change the model of numworks. You have chose of n0100, n0110, and the new model n0120
    Note: This change the speed python execution emulation of numworks

  • Shorcut command: All the features mentioned have a shortcut command. More info in the "Help" button of the window

Environ options
/!\ You must make its additions before importing kandinsky otherwise the changes will not take effect! /!\

You can also change some default option of library, like the OS or model on which to start kandinsky, etc.
To do this, first import the environ of os module like this: import os.

  • To enable debug mode, add:
os.environ['KANDINSKY_ENABLE_DEBUG'] = '' 
  • To change starting OS, add:
# '0': PC, '1': Numworks, '2': Omega, '3': Upsilon
os.environ['KANDINDKY_START_OS'] = '<number>'
  • To change starting Model, add:
# '0': n0100, '1': n0110, '2': n0120
os.environ['KANDINDKY_START_MODEL'] = '<number>'
  • To disable user interface (menus at top of window), add:
os.environ['KANDINSKY_NO_GUI'] = ''

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

kandinsky-2.1.dev1.tar.gz (113.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kandinsky-2.1.dev1-py3-none-any.whl (115.1 kB view details)

Uploaded Python 3

File details

Details for the file kandinsky-2.1.dev1.tar.gz.

File metadata

  • Download URL: kandinsky-2.1.dev1.tar.gz
  • Upload date:
  • Size: 113.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for kandinsky-2.1.dev1.tar.gz
Algorithm Hash digest
SHA256 037f7151148545b0bcff924abc24497f7df8605a414d4cf93e88f97438aad2a8
MD5 520e6e465a72bd278d6b76dbed1c69c9
BLAKE2b-256 2d5c1f341408a6ef150a845fdd6eb73dd19e267d305ae0b04a708c046776e18d

See more details on using hashes here.

File details

Details for the file kandinsky-2.1.dev1-py3-none-any.whl.

File metadata

  • Download URL: kandinsky-2.1.dev1-py3-none-any.whl
  • Upload date:
  • Size: 115.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for kandinsky-2.1.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 21788dfa33bdbf848ce32c2ac34487d0db9382e3532addfb8b78269357a772b4
MD5 e4142f3e04e81a79c02a182668683f7d
BLAKE2b-256 b4d513ce7d5a9e51bbe0a69c9d05482acbb0fa92fc8dfe4588c118e614fd7707

See more details on using hashes here.

Supported by

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