Is Jython alive

functionactionmakeTurtle ()creates a (global) turtle in the new graphics windowmakeTurtle (color)creates a turtle with the specified colormakeTurtle ("sprites / turtle.gif")creates turtle with its own turtle image turtle.gift = Turtle ()creates a turtle object t tf = TurtleFrame ()creates a screen window in which several turtles livet = Turtle (tf)creates a turtle object t in the TurtleFrame tfclone ()creates a turtle clone (same color, position, line of sight)isDisposed ()returns True if the turtle window is closedputSleep () stops the program flow until wakeUp () is called wake up()continues the paused program sequence enableRepaint (False)turns off automatic screen renderingrepaint ()renders the screen (after turning off automatic rendering)savePlayground ()saves the playground in an internal image buffer (retrieve with clear ())savePlayground (fileName, format)saves the playground as an image file (format: "png" or "gif"). False is returned in the event of an errorsetPlaygroundSize (width, height)sets the size of the turtle window regardless of the settings in TigerJython (must be called before makeTurtle ())setFramePosition (x, y)sets the upper left corner of the turtle window to the given screen position setFramePositionCenter ()puts the turtle window in the middle of the screen
back (distance), bk (distance)moves Turtle backwards forward (distance), fd (distance)moves Turtle forward hideTurtle (), ht ()makes Turtle invisible (Turtle draws faster) home ()puts Turtle in the middle of the window with an upward directionleft (angle), lt (angle)turns Turtle to the left penDown (), pd ()drops pen (trace visible) penErase (), pe () sets the pen color to the background colorleftArc (radius, angle)moves Turtle on an arc with the sector angle angle to the left leftCircle (radius)moves Turtle to the left on a circle penUp (), pu ()lifts the pen (trace invisible) penWidth (width) sets the thickness of the pen in pixelsright (angle), rt (angle) turns Turtle to the right rightArc (radius, angle) moves Turtle on an arc with the sector angle angle To the right rightCircle (radius) moves Turtle to the right on a circlesetCustomCursor (cursorImage)selects the image file of the mouse cursorsetCustomCursor (cursorImage, Point (x, y))selects the image file of the mouse cursor, specifying the mouse position within the imagesetLineWidth (width)sets the thickness of the pen in pixelsshowTurtle (), st ()shows Turtle speed (speed) sets turtle speed (1 to 1000, default 200)
With speed (-1) the turtle moves the fastest (without animation)delay (time) stops the program during time (in milliseconds)wrap () resets turtle positions outside the window in the windowclip () turtles outside the window are not visiblegetPlaygroundWidth ()returns the width m of the turtle window (turtle coordinates -m / 2 ... m / 2)getPlaygroundHeight ()returns the height n of the turtle window (turtle coordinates -n / 2 ... n / 2)
direction (x, y) returns the angle (in degrees) for the rotation to position (x, y)direction (coords) the same thing, but the coordinates are specified as a list, tuple or complex numberdirection (turtle) returns the angle (in degrees) for the rotation to another turtledistance (x, y) returns the distance of the turtle to the point (x, y) distance (coords) the same, but the coordinates are specified as a list, tuple or complex numberdistance (turtle) returns the distance of the turtle to another turtle
getPos () returns the turtle position as a pointgetX () returns the current x-coordinate of the turtlegetY () returns the current y-coordinate of the turtleheading () returns the direction of the turtleheading (degrees) sets the direction of the turtle (0 is up, clockwise)moveTo (x, y)moves turtle to position (x, y)moveTo (coords)the same, but the coordinates are specified as a list, tuple or complex numbersetHeading (degrees), setH (degrees)sets the direction of the turtle (0 up, clockwise)setRandomHeading ()sets the direction randomly between 0 and 360 °setPos (x, y)sets Turtle to position (x, y) setPos (coords)the same thing, but the coordinates are specified as a list, tuple or complex numbersetX (x)sets Turtle to the x-coordinatesetY (y)sets Turtle to y-coordinatesetRandomPos (width, height)sets Turtle to a random point in the range 0..width, 0..heightsetScreenPos (x, y)sets Turtle to given pixel coordinates (x, y)setScreenPos (Point (x, y))sets Turtle to given pixel coordinates towards (x, y)gives the direction (in degrees) to the position (x, y) (also list, tuple, complex)towards (turtle2)returns the direction (in degrees) to another turtle turtle2toTurtlePos (x, y)Returns the turtle coordinates for the given pixel coordinates (x, y) as a listtoTurtlePos (Point (x, y))returns the turtle coordinates for the given pixel coordinates as a listpushState ()saves the turtle state in a stackpopState ()gets the last saved state from the stackclearStates ()clears the stack
askColor (title, defaultColor) shows a window for color selection and returns the selected color, (None, if Cancel was pressed) title: window title, defaultColor: color suggestionclear () erases the drawing and hides all turtles (they stay in place). If the image buffer created with savePlayground () is not empty, it will be displayedclear (color) erases the drawing, hides all turtles (they stay in place) and colors the background clean () deletes the turtle tracks (turtles remain visible at the location). The image buffer created with savePlayground () is deletedclean (color) deletes the drawing and colors the background (turtles remain visible in place). clearScreen (), cs ()deletes the turtle tracks and places the turtle in its home positiondot (diameter) draws a circle filled with pen color openDot (diameter) draws an unfilled circle spray (density, spread, size)draws a random point cloud at the turtle position with given number of points, extent and point size (without size: size = 1)fill () fills the closed figure in which the turtle is located with the fill colorfill (x, y) fills a closed figure around the inner point (x, y) with the fill color fill (coords) the same, but the coordinates are specified as a list, tuple or complex numberfillToPoint () continuously fills the drawn figure from the current turtle position with the pen colorfillToPoint (x, y) continuously fills the drawn figure from point (x, y) with the pen color fillToPoint (coords the same thing, but the coordinates are specified as a list, tuple or complex numberfillToHorizontal (y) continuously fills the area between the figure and the horizontal line at height y with the pen colorfillToVertical (x) continuously fills the area between the figure and the vertical line at the value x with the pen colorfillOff () ends the continuous filling mode getColor () returns the turtle colorgetColorStr () returns the X11 turtle colorgetFillColor () returns the fill colorgetFillColorStr () returns the X11 fill colorgetPixelColor () returns the color of the pixel at the turtle coordinate
(None, if outside the turtle window)getPixelColorStr () returns the color of the pixel at the turtle coordinate as an X11 color
(empty string, if no X11 color name exists; None, if outside the turtle window)makeColor ()returns a color reference of value. Value examples: ("7FFED4"), ("Aqua-Marine"), (0x7FFED4), (8388564), (0.5, 1.0, 0.83), (128, 255, 212), ("rainbow", n) with n = 0..1, light spectrummakeColor (color, alpha)creates a transparent color for alpha between 0 and 1 (makeColor ("red", 0.25))getRandomX11Color () returns a random X11 colorsetColor (color) sets turtle colorsetPenColor (color) sets pen color setPenWidth (width) sets the thickness of the pen in pixelssetFillColor (color) sets the fill color startPath () starts the recording of the turtle movement for subsequent fillingfillPath () connects the current turtle position with the starting point and fills the closed figure with the fill colorstampTurtle () creates a turtle image at the current turtle positionstampTurtle (color) creates a turtle image with the specified color at the current turtle position
makeTurtle (mouseNNN = onMouseNNN)
also several, separated by commas registers the callback function onMouseNNN (x, y), which is called during the mouse event. Values ​​for NNN: Pressed, Released, Clicked, Dragged, Moved, Entered, Exited, SingleClicked, DoubleClicked, Hit: Call in own thread, HitX: The same, but subsequent events are ignored until Callback returns isLeftMouseButton (),
isRightMouseButton ()returns True if the left or right mouse button was used during the event
makeTurtle (keyNNN = onKeyNNN)
registers the callback function onKeyNNN (keyCode), which is called when a keyboard key is pressed. Values ​​for NNN: Pressed, Hit: Call in own thread, HitX: The same, but subsequent events are ignored until Callback returns. keyCode is a unique integer code for the key getKeyModifiers () delivers a code for special keys (Shift, Ctrl, etc., also combined) after a keyboard event makeTurtle (closeClicked = onCloseClicked) registers the callback function onCloseClicked (), which is called when the close button of the turtle window is clicked. The window must be closed with dispose () makeTurtle (turtleHit = onTurtleHit) registers the callback function onTurtleHit (x, y), which is called when the turtle image is clicked t = Turtle (turtleHit = onTurtleHit)registers the callback function onTurtleHit (t, x, y), which is called when the image of the turtle t is clicked showSimulationBar (NNN = onNNN)shows a dialog window with the buttons 'Step', 'Run' / 'Pause', 'Reset' and a slider for setting the simulation period. The following callbacks NNN can be registered: start, pause, step, reset, change (parameter: simulationPeriod), loop, exit (close button pressed). loop is called by the simulation thread in every simulation cycleshowSimulationBar (ulx, uly, initPeriod, NNN = onNNN)as above, but with positioning of the dialog window (upper left corner) and initial value of the simulation period (default: 100)hideSimulationBar ()closes the dialog window and releases all resources
addStatusBar (20)adds a status bar with a height of 20 pixelsbeep ()makes a soundplayTone (freq)plays sound with given frequency (in Hz) 1000 ms (blocking function)playTone (freq, block = False)the same but non-blocking function (to play several tones at the same time)playTone (freq, duration)plays sound with a given frequency and duration playTone ([f1, f2, f3 ...])plays several tones one after the other with given frequencies playTone ([(f1, d1), (f2, d2), (f3, d3) ...])plays several tones one after the other with given frequencies and duration playTone ([("c", 700), ("e", 1500) ...]plays several tones one after the other with given tone names and given duration. The following are allowed: large octave, one-, two- and three-stroke octave, i.e. in the range c, c #, ... h '' ')playTone ([("c", 700), ("e", 1500) ...], instrument = "piano")As before, but with the chosen instrument (piano, quitar, harp, trumpet, organ, panfluete, seashore, violin, xylophone ... (according to MIDI specification)).
playTone ([("c", 700), ("e", 1500 ...)], instrument = "piano", volume = 10)as before, but with selected volume (0 .... 100)label (param) writes str (param) at the current position (left-justified)label (param1, param2, ...)concatenates str (params) separated by spaces and writes out the textlabel (param1, param2, ..., adjust = 'x')same, but with x = 'l' left-justified (default), 'c' centered, 'r' right-justifiedprinterPlot (draw) prints the drawing created with the draw functionsetFont (Font font) sets the font. font is an object of the Font class
Example:. Font ("Courier New", Font.BOLD, 12). Default: Font ("SansSerif", Font.PLAIN, 24)setFont (name)defines new font with existing font style and font sizesetFont (name, style)defines a new font and font style with the existing font size
style = Font.PLAIN, Font.BOLD, Font.ITALICsetFont (name, style, size)defines new font, font style and font sizesetFontSize (size) sets new font size (font and style are retained)getTextHeight ()returns the height of the text in the current font (in pixels)getTextAscent ()returns the height of the text ascender in the current font (in pixels)getTextDescent ()returns the height of the text decender in the current font (in pixels)getTextWidth (text)returns the width of the given text in the current font (in pixels)setStatusText ("Press any key!")writes a message in the status barsetTitle ("Text")writes the text in the title lineimg = getImage (path)loads an image (in png-gif, jpg format) from the local file system or from a URL and returns a reference to it. For path = sprites / nnn, images from the TigerJython distribution are also loaded (Help / image library shows the images available)drawImage (img)displays the image img at the position of the turtle with its line of sightdrawImage (path)loads an image (in png, gif, jpg format) from the local file system or from a URL and displays it at the position of the turtle with its viewing direction. For path = sprites / nnn, images from the TigerJython distribution are also loaded
rec = VideoRecorder (turtle, filename, resolution)creates an MP4 (H.264 / AVC) video encoder that records the turtle window (turtles, tracks and images) and saves it in the given file. resolution must be a string with a supported resolution, for example "640x480". getSupportedResolutions () returns the currently supported resolutionrec = VideoRecorder (turtleFrame, filename, resolution)same thing with a TurtleFramerec = VideoRecorder (turtle, filename, resolution, ulx, uly)the same with indication of the position of the upper left corner of the turtle window with respect to the video image. Default values ​​0, 0 rec = VideoRecorder (turtleFrame, filename, resolution)the same with a TurtleFrameVideoRecorder.getSupportedResolutions ()delivers a string with all currently supported video resolutionsrec.captureImage ()takes a single picture (frame). The recording can take place at any time interval. The frame rate depends on the resolution (usually 25 frames / s)rec.captureImage (nb)the same, but the same pictures are takenrec.finish ()the recording stops and the video file is closed
msgDlg (message)opens a modal dialog with an OK button and given message textmsgDlg (message, title = title_text)the same with titleinputInt (prompt)opens a modal dialog with OK / Cancel buttons. OK returns the entered integer (if no integer, the dialog is redisplayed). Cancel or close ends the programinputInt (prompt, False)same thing, but Cancel / Close does not terminate the program, it returns NoneinputFloat (prompt)opens a modal dialog with OK / Cancel buttons. OK returns the entered float (if no float, the dialog is redisplayed). Cancel or close ends the programinputFloat (prompt, False)same thing, but Cancel / Close does not terminate the program, it returns NoneinputString (prompt)opens a modal dialog with OK / Cancel buttons. OK returns the entered string. Cancel or close ends the programinputString (prompt, False)same thing, but Cancel / Close does not terminate the program, it returns Noneinput (prompt)opens a modal dialog with OK / Cancel buttons. OK returns input as an integer, float or string. Cancel or close ends the programinput (prompt, False)same thing, but Cancel / Close does not terminate the program, it returns NoneaskYesNo (prompt)opens a modal dialog with yes / no buttons. Yes returns True, No returns False. Close ends the programaskYesNo (prompt, False)same thing, but close does not terminate the program, it returns None
server = TCPServer (port, stateChanged, isVerbose = False)creates a TCP socket server that listens to clients on the TCP port.State changes call stateChanged (). Debug messages are written out for isVerbose = TruestateChanged (state, msg)

Callback that is called when the status changes.
state: TCPServer.PORT_IN_USE, msg: port
state: TCPServer.CONNECTED, msg: IP address of the client
state: TCPServer.LISTENING, msg: empty
state: TCPSever.TERMINATED, msg: empty
state: TCPServer.MESSAGE, msg: Message (string) received from the client

server.isConnected ()True if a client is connected to the serverserver.disconnect ()terminates the connection with the client and goes into the LISTENING stateserver.terminate ()terminates the connection and the LISTENNG status, releases the IP portserver.isTerminated ()True if the server is in the TERMINATED stateserver.sendMessage (msg)sends the information msg to the client (as a string, the character \ 0 (ASCII 0) serves as the end character, automatically and transparently added and removed again). TCPServer.getVersion ()returns the version of the module as a string
client = TCPClient (ipAddress, port, stateChanged, isVerbose = False)

creates a TCP socket client that is prepared for a connection to a TCPServer with the IP address ipAddress (string) and the TCP port port. State changes call stateChanged (). For isVerbose = True, debug messages are written out on the console

stateChanged (state, msg)Callback that is called when the status changes.
state: TCPClient.CONNECTING, msg: IP address of the server
state: TCPClient.CONNECTION_FAILED, msg: IP address of the server
state: TCPClient.CONNECTED, msg: IP address of the server
state: TCPClient.DISCONNECTED, msg: empty
state: TCPClient.MESSAGE, msg: Message (string) received from the serverclient.connect ()creates a connection to the server (blocking until timeout). Returns True if the connection was established, otherwise False is returnedclient.connect (timeout)the same, but specification of the timeout (in s) for the connection attemptclient.isConnecting ()True while the client is attempting to connectclient.isConnected ()True if the client is connected to a serverclient.disconnect ()terminates the connection with the serverclient.sendMessage (msg, responseTime)sends the information msg to the server (as a string, the character \ 0 (ASCII 0) serves as the end character, automatically and transparently added and removed again). For responseTime> 0 the method is blocking and expects a response within responseTime (in s). The answer is provided as a return value. If the answer does not arrive, None is returnedTCPClient.getVersion ()returns the version of the module as a string