VPython 6 will run almost all old VPython programs correctly without change The following details about changes may be important in a few unusual cases.

An animation loop must contain a rate or sleep statement, which limits the number of loop iterations per second as before but also when appropriate (about 30 times per second) updates the 3D scene and handles mouse and keyboard events. Without a rate or sleep statement, the scene will not be updated until and unless the loop is completed. Most animation loops already contain a rate statement anyway, to make the animation not run too fast.

You should use the new function sleep rather than time.sleep. The new function periodically renders the scene and processes mouse events, making it possible to continue using zoom and rotate, whereas time.sleep does not do this. Programs that use time.sleep will work, but you won't be able to zoom or rotate during the sleep period.

You must import visual or vis before importing graph or controls or filedialog, which most users have always done anyway.

To rotate the camera around the scene, drag with the right button down, or with the Ctrl key down. To zoom in or out, drag with both the left and right buttons down or with the Alt key down (also called Option on the Macintosh).

How to learn about VPython

VPython is the Python programming language plus a 3D
graphics module called "Visual" originated by David Scherer in 2000. This
documentation describes all of the VPython capabilities.

Be sure to explore the many example programs that are installed with VPython.

GlowScript: GlowScript (glowscript.org) now supports VPython, which allows VPython programs to run in a browser. See the Help and VPython Help at glowscript.org.

iPython: John Coady has implemented VPython to run in iPython notebooks, with his ivisual module.

To invoke the Visual
module, place the following statement at the start of the file:

from visual import *

If you are using Python 2.7 or earlier, to make sure that 3/4 is treated as 0.75 rather than zero, start your program with the following statements (there are two underlines before future and two underlines after future):

from __future__ import division
from visual import *

This is not necessary with Python 3.0 or later, but it doesn't hurt, and including the division statement ensures that your program will handle division the same way on all versions of Python.

For experienced programmers

As a convenience to novice programmers to provide everything that is needed to get started, the statement "from visual import *" imports all of the VPython 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 VPython objects selectively, import them from the vis module. Two simple examples: