A small module allowing to link the kandinsky module, from the Numworks, to a window.
Project description
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
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
Hashes for kandinsky-2.0.dev5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf7f78aaa2579bb7b1f97a5fc911a490fcfee0036c2c09413ea777a77ae56116 |
|
MD5 | 76fe95ce4ac1a6dd735e56b3797a677f |
|
BLAKE2b-256 | 52c2bf8e6585863e9557945534224a39b135ca780d9d46871ed3fbe10322ecd9 |