Package: kandinsky
Kandinsky-NumworksThis module depend toPySDL2module and sdl2 libraries, PySDL2 is just ansdl2wrapper with ctype and it just call methods in sdl2 library. To install both modules, clickhereand 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 hasmany other features.InstallationYou now have the option to install this module onpypi.org. For that, follow the stepshere.Or if you want, you can build it yourself, just run the command./setup.MoreI also recreated the ion module of the Numworks, check it out here:Ion module of NumworksIf you have a question, check out theFAQ. And if you have a suggestion or your question is not answered, open anIssue.Usable contentNumworks, aka basic, methodsget_pixel():Parameters:x,yDescription: Return pixel (x, y) colorset_pixel():Parameters:x,y,colorDescription: Color pixel (x, y)color():Parameters:r,g,bDescription: Define a rgb colordraw_string():Parameters:text,x,y,color[default: (0,0,0)],background[default: (248,252,248)],(Omega & Upsilon only:font[default: False])Description: Display a text from pixel (x, y)Note: parameterfontis only for Omega and Upsilon and it's to chose between small and large font.fill_rect():Parameters:x,y,width,height,colorDescription: Fill a rectangle at pixel (x, y)New method for this library, only on Computerquit():Parameters:No parametersDescription: Close manualy the window without notifying the userNote: after that you cannot reopen the window, so a re-import of kandinsky will be required to get a new windowdisplay():Parameters:No parametersDescription: Refresh manually the window and display changesNote:⚠️Method added only for MacOS, because library cannot refresh automatically the window in another Thread.It will be necessary to call this method from time to time to keep it alive.⚠️New methods added by Omega (previous methods are also added)draw_line()Parameters:x1,y1,x2,y2,colorDescription: Draw a line at (x1, y1) to (x2, y2)wait_vblank()Parameters:No parametersDescription: Wait for screen refreshget_keys()Parameters:No parametersDescription: Get name of pressed keysNew methods added by Upsilon (previous methods are also added except get_keys())draw_circle()Parameters:x,y,r,colorDescription: Draw circle at (x, y) of radius rfill_circle()Parameters:x,y,r,colorDescription: Fill circle at (x, y) of radius rfill_polygon()Parameters:points,colorDescription: Fill polygon at points [(x1, y1), ...]get_palette()Parameters:No parametersDescription: Get theme paletteAdditional featuresA GUI to control emulatorPause/resume:You can pause/resume your scriptNote:This will just pause the calls of kandinsky. So for the script to pause, it must be called one of the functions of the libraryScreenshot:You can also take a screenshot of windowNote:This take just the numworks interface and drawable area, not the GUIChange OS:Change the speed of execution. You have chose ofNumworks,Omega,Upsilon, andPCmodeNote:Only work for kandinsky methodsChange model:Change the model of numworks. You have chose ofn0100,n0110, and the new modeln0120Note:This change the speed python execution emulation of numworksNote2:n0100 and n0120 models are not available for moment.Shorcut command:All the features mentioned have a shortcut command. More info in "Help > Shortcuts" menu of window.Environ options/!\ You must make its additionsbeforeimporting 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 os module and add a compatibility check, like this:try:importosifhasattr(os,"environ"):"<environ options here>"except:passEnable debug mode:os.environ['KANDINSKY_ENABLE_DEBUG']=''Change starting OS (methods according to the selected os will be created):# '0': PC speed + all methods# '1': Numworks speed + Basic methods# '2': Omega speed + draw_line,wait_vblank,get_keys method# '3': Upsilon speed + draw_circle,fill_circle,fill_polygon,get_palette methods - get_keysos.environ['KANDINSKY_OS_MODE']='<number>'Change starting Model:# '0': n0100 model speed (not available for moment)# '1': n0110 model speed# '2': n0120 model speed (not available for moment)os.environ['KANDINSKY_MODEL_MODE']='<number>'Remove the user interface of window (GUI):# Note: Shortcut commands are not disabledos.environ['KANDINSKY_NO_GUI']=''Change size of screen:os.environ['KANDINSKY_SCREEN_SIZE']="<width>x<height>"Zoom the window:# from 1 to 4os.environ['KANDINSKY_ZOOM_RATIO']="<number>"