Introduction
VPython is Open Source, and a part of the Python Library,
combining the Python programming language with a 3D
graphics module called Visual. (Wikipedia)
There are two ways to use VPython.
(From VPython documentation.)
- WebVPython, the web version, runs in a browser and requires
no software installation. WebVPython is faster that Python
(sometimes as much as a factor of 30), because it is
transpiled to JavaScript before running. However the web version
does not provide access to Python modules such as numpy,
pandas, etc.
- vpython is a Python module that can be installed.
Once installed, you can import the vpython module like any other
module. The graphical display will appear in a browser window when
you run a program.
Links
VPython (Wikipedia)
WebVPython
VPython (Home)
VPython Documentation
VPython installation
Trinket
Trinket
(Code is Your Canvas)
Trinket Python3
Examples of VPython Programs
Example #1
Example #2
Example #3
Miscellaneous (from the web)
Install the VPython module with installed Python.
(Install in a virtual environment?)
pip install vpython
Which version of the VPython module am I using?
import vpython
print(vpython.__version__)
Draw a sphere.
from vpython import *
sphere()
Draw a cylinder with specified position, axis, and radius
from vpython import *
cylinder(pos=vector(0,0,0), axis=vector(5,0,0), radius=1)