Welcome to the Jython Environment for Students (JES), Version 3.1! We have made several changes since our last release, so take a look around. Some of these changes were implemented thanks to work done at Kalamazoo College. All changes in this version are listed below.
Environmenttrue
and false
constants have been added.input()
and raw_input()
now present users with dialog boxes for input.\u
. The following code no longer works:
>>> unicodeString = u"\u0061\u0062"
>>> print unicodeString
ab
Instead use the following:
>>> unicodeString = u"\u0061\u0062"
>>> encodedString = unicodeString.encode('utf-8') #or some other codec
>>> print encodedString
ab
This is a Python change, not a JES change.
setMediaPath()
and setMediaFolder()
can now take a directory path as input.
The old functionality of sending no arguments and getting a file chooser still works.getMediaPath()
or getMediaFolder()
with no arguments now returns the
current media folder.setLibPath()
adds a folder to the user's Python path, so that user-created
modules can be imported. Like setMediaPath()
and setMediaFolder()
, this method
works with no arguments or with a directory path as input.
addArc(), addArcFilled(), addOval(), addOvalFilled()
addLine()
addRect()
addRectFilled()
addText()
addTextWithStyle()
makeEmptyPicture()
as well as the new methods listed above.show()
now repaints automatically.getPixelAt()
is a new method with the same functionality as getPixel()
setRed()
, setGreen()
, setBlue()
) now perform error checking
if the Color Wraparound option is deselected.setColorWrapAround()
and getColorWrapAround()
.crop()
and a more sophisticated copyInto()
are available when using Object-Oriented notation.
These methods are not listed in the JES Functions menu.explore()
method will take a Picture object and open up the Picture Tool.makeEmptySound()
now takes a number of samples instead of a number of seconds. To create
a sound in terms of seconds, use the new method makeEmptySoundBySeconds()
. In addition, both
methods optionally take a sampling rate as a parameter along with the duration.getSample()
and setSample
have been replaced by getSampleValue()
and setSampleValue()
.getNumSamples()
is a new method that returns the number of samples in a sound, same as getLength()
.getDuration()
is a new method that returns the length of the sound in seconds.stopPlaying()
is a new method that forces a sound to cease playback.explore()
method will take a Sound object and open up the Sound Tool.copySoundInto()
and cropSound()
are available when using Object-Oriented notation only. These methods
are not listed in the JES Functions menu.playAtRate(), playAtRateDur(), playInRange(), blockingPlayInRange(), playAtRateInRange(), blockingPlayAtRateInRange()
explore()
method will take a Movie object and open up the Frame Sequencer Tool.writeQuicktime()
will write out movies in MOV format.turnToFace()
can now take a turtle as input rather than (x,y) coordinates.turn()
now takes a floating point number rather than an integer as input.getHeading()
now returns the heading of the turtle in degrees.showVars()
has been reintroduced. When called, a new window will
appear, showing the value and type of any variable available in the command area.