Skip to main content

VPython for Jupyter Notebook

Project description

# VPython
This package enables one to run VPython, using the GlowScript VPython API, documented in the Help at http://glowscript.org. It can be used in a Jupyter notebook or run from IDEs such as IDLE or Spyder. VPython makes it unusually easy to create navigable real-time 3D animations. The one-line program "sphere()" produces a 3D sphere with appropriate lighting and with the camera positioned so that the scene fills the view. It also activates mouse interactions to zoom and rotate the camera view. The 3D scene appears in a browser page or a Jupyter notebook, using the WebGL-based GlowScript 3D graphics library. This implementation of VPython was begun by John Coady in May 2014 with further development by Ruth Chabay and Bruce Sherwood and with installers built by Matt Craig. The repository for the source code is at https://github.com/BruceSherwood/vpython-jupyter.

For instructions on how to use VPython, see http://vpython.org.

Here is a simple example of VPython code:

from vpython import *
sphere()

This will create a 3D canvas containing a 3D sphere, with mouse and touch controls available to zoom and rotate the camera:

Right button drag or Ctrl-drag to rotate "camera" to view scene.
To zoom, drag with middle button or Alt/Option depressed, or use scroll wheel.
On a two-button mouse, middle is left + right.
Touch screen: pinch/extend to zoom, swipe or two-finger rotate.

Run example VPython programs: [![Binder](http://mybinder.org/badge.svg)](http://mybinder.org/repo/BruceSherwood/vpython-jupyter)

VPython programs that don't import other Python modules can run without change at glowscript.org, which uses the RapydScript-NG Python-to-JavaScript transpiler to enable compilation and execution in the browser, without installing any software.

Project details


Release history Release notifications | RSS feed

This version

7.0.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vpython-7.0.0.tar.gz (2.5 MB view hashes)

Uploaded Source

Built Distributions

vpython-7.0.0-cp36-cp36m-win_amd64.whl (2.5 MB view hashes)

Uploaded CPython 3.6m Windows x86-64

vpython-7.0.0-cp36-cp36m-win32.whl (2.5 MB view hashes)

Uploaded CPython 3.6m Windows x86

vpython-7.0.0-cp36-cp36m-macosx_10_7_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.6m macOS 10.7+ x86-64

vpython-7.0.0-cp35-cp35m-win_amd64.whl (2.5 MB view hashes)

Uploaded CPython 3.5m Windows x86-64

vpython-7.0.0-cp35-cp35m-win32.whl (2.5 MB view hashes)

Uploaded CPython 3.5m Windows x86

vpython-7.0.0-cp35-cp35m-macosx_10_7_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.5m macOS 10.7+ x86-64

vpython-7.0.0-cp34-cp34m-win_amd64.whl (2.5 MB view hashes)

Uploaded CPython 3.4m Windows x86-64

vpython-7.0.0-cp34-cp34m-win32.whl (2.5 MB view hashes)

Uploaded CPython 3.4m Windows x86

vpython-7.0.0-cp34-cp34m-macosx_10_6_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.4m macOS 10.6+ x86-64

vpython-7.0.0-cp27-cp27m-win_amd64.whl (2.5 MB view hashes)

Uploaded CPython 2.7m Windows x86-64

vpython-7.0.0-cp27-cp27m-win32.whl (2.5 MB view hashes)

Uploaded CPython 2.7m Windows x86

vpython-7.0.0-cp27-cp27m-macosx_10_7_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 2.7m macOS 10.7+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page