Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

VPython for Jupyter Notebook

Project description

# VPython

This package enables one to run VPython in a browser, using the GlowScript
VPython API, documented in the Help at http://glowscript.org. If the code is
in a cell in a Jupyter notebook, the 3D scene appears in the Jupyter notebook.
If the code is launched outside a notebook (e.g. from the command line), a
browser window will open displaying the scene.

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. This
implementation of VPython was begun by John Coady in May 2014. Ruth Chabay and
Bruce Sherwood are assisting in its further development. The repository for
the source code is at https://github.com/BruceSherwood/vpython-jupyter.

## Installation

For more detailed instructions on how to install vpython, see http://vpython.org, where you will also find a link to the VPython forum, which is the preferred place to report issues and to request assistance.

Briefly:

+ If you use the [anaconda python distribution](https://www.continuum.io/anaconda-overview), install like this: `conda install -c vpython vpython`
+ If you use any other python distribution, install this way: `pip install vpython`

## Sample program

Here is a simple example:

```python
from vpython import *
sphere()
```

This will create a 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.

Currently, to re-run a VPython program you need to click the circular arrow icon to "restart the kernel" and then click the red-highlighted button, then click in the first cell, then click the run icon. Alternatively, if you insert "scene = canvas()" at the start of your program, you can rerun the program without restarting the kernel.

Run example VPython programs: [![Binder](http://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/BruceSherwood/vpython-jupyter/7.1.2?filepath=index.ipynb)

## vpython build status (for the vpython developers)

[![Build Status](https://travis-ci.org/BruceSherwood/vpython-jupyter.svg?branch=master)](https://travis-ci.org/BruceSherwood/vpython-jupyter) [![Build status](https://ci.appveyor.com/api/projects/status/wsdjmh8aehd1o0qg?svg=true)](https://ci.appveyor.com/project/mwcraig/vpython-jupyter)

Project details


Release history Release notifications

History Node

7.4.4

History Node

7.4.3

This version
History Node

7.4.2

History Node

7.4.1

History Node

7.4

History Node

7.3.2

History Node

7.3.1

History Node

7.3.0

History Node

7.2.0

History Node

7.1.6

History Node

7.1.5

History Node

7.1.4

History Node

7.1.3

History Node

7.1.2

History Node

7.1.1

History Node

7.1.0

History Node

7.0.3

History Node

7.0.2

History Node

7.0.1

History Node

7.0.0

History Node

7.0.0b5

History Node

7.0.0b4

History Node

7.0.0b3

History Node

7.0.0b2

History Node

7.0.0b1

History Node

2.0.8

History Node

2.0.7

History Node

2.0.6

History Node

2.0.5

History Node

2.0.4

History Node

2.0.3

History Node

2.0.2

History Node

2.0.1

History Node

2.0

History Node

1.0.9

History Node

1.0.8

History Node

1.0.7

History Node

1.0.6

History Node

1.0.5

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

History Node

0.3.11

History Node

0.3.10

History Node

0.3.9

History Node

0.3.8

History Node

0.3.7

History Node

0.3.6

History Node

0.3.5

History Node

0.3.4

History Node

0.3.3

History Node

0.3.2

History Node

0.3.1

History Node

0.3.0

History Node

0.2.0b16

History Node

0.2.0b15

History Node

0.2.0b14

History Node

0.2.0b13

History Node

0.2.0b12

History Node

0.2.0b11

History Node

0.2.0b10

History Node

0.2.0b9

History Node

0.2.0b8

History Node

0.2.0b7

History Node

0.2.0b6

History Node

0.2.0b5

History Node

0.2.0b4

History Node

0.2.0b3

History Node

0.2.0b2

History Node

0.2.0b1

History Node

0.1.0a4

History Node

0.1.0a3

History Node

0.1.0a2

History Node

0.1.0a1

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
vpython-7.4.2-cp27-cp27m-win32.whl (4.0 MB) Copy SHA256 hash SHA256 Wheel cp27 Mar 14, 2018
vpython-7.4.2-cp27-cp27m-win_amd64.whl (4.0 MB) Copy SHA256 hash SHA256 Wheel cp27 Mar 14, 2018
vpython-7.4.2-cp34-cp34m-win32.whl (3.9 MB) Copy SHA256 hash SHA256 Wheel cp34 Mar 14, 2018
vpython-7.4.2-cp34-cp34m-win_amd64.whl (4.0 MB) Copy SHA256 hash SHA256 Wheel cp34 Mar 14, 2018
vpython-7.4.2-cp35-cp35m-win32.whl (3.9 MB) Copy SHA256 hash SHA256 Wheel cp35 Mar 14, 2018
vpython-7.4.2-cp35-cp35m-win_amd64.whl (4.0 MB) Copy SHA256 hash SHA256 Wheel cp35 Mar 14, 2018
vpython-7.4.2-cp36-cp36m-win32.whl (3.9 MB) Copy SHA256 hash SHA256 Wheel cp36 Mar 14, 2018
vpython-7.4.2-cp36-cp36m-win_amd64.whl (4.0 MB) Copy SHA256 hash SHA256 Wheel cp36 Mar 14, 2018
vpython-7.4.2.tar.gz (4.0 MB) Copy SHA256 hash SHA256 Source None Mar 14, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page