Now available at vpython.org: Visual 5.4 for Python 2.7 and Python
3.1, for Windows and Mac.
This release includes a new module, "vis", which permits selective
import of Visual objects without the importing of math and numpy that
is done for "from visual import *". See below for details.
The font modules included in this VPython installer have been updated
to work with Python 3.1, but tested only to the extent that they work
with VPython. It is quite possible that additional work is needed to
make them fully functional with Python 3.1.
Ned Deily fixed a problem with IDLE (and VIDLE) on Macs; it was
recently noticed that quitting on the Mac did not prompt you to save
unsaved code.
The new Python 3 series is deliberately somewhat incompatible with the
older Python 2 series. The main difference for the purposes of VPython
programs is that instead of print "hello" you now say print("hello").
This new form of print also works in Python 2.7.
USING THE NEW vis MODULE
As a convenience to novice programmers to provide everything needed to
get started, "from visual import *" imports all of the Visual features
and executes "from math import *" and "from numpy import *". It also
arranges that for routines common to both math and numpy such as sqrt,
the much faster math routine is used when possible (when the argument
is a scalar rather than an array).
If you want to import the visual objects selectively, import them from
the vis module. Two simple examples:
import vis
vis.box(color=vis.color.orange,material=vis.materials.wood)
from vis import (box, color, materials)
box(color=color.orange, material=materials.wood)
There are clean modules vis.controls, vis.filedialog, and vis.graph
equivalent to the modules visual.controls, visual.filedialog, and
visual.graph. The latter versions execute "from visual import *" and
are retained because some programs expect that behavior when importing
one of these modules.
The documentation is written assuming that "from visual import *" is used.
Bruce Sherwood
|