Skip to main content

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 | RSS feed

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.4.2.tar.gz (4.0 MB view details)

Uploaded Source

Built Distributions

vpython-7.4.2-cp36-cp36m-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.6mWindows x86-64

vpython-7.4.2-cp36-cp36m-win32.whl (3.9 MB view details)

Uploaded CPython 3.6mWindows x86

vpython-7.4.2-cp35-cp35m-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.5mWindows x86-64

vpython-7.4.2-cp35-cp35m-win32.whl (3.9 MB view details)

Uploaded CPython 3.5mWindows x86

vpython-7.4.2-cp34-cp34m-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.4mWindows x86-64

vpython-7.4.2-cp34-cp34m-win32.whl (3.9 MB view details)

Uploaded CPython 3.4mWindows x86

vpython-7.4.2-cp27-cp27m-win_amd64.whl (4.0 MB view details)

Uploaded CPython 2.7mWindows x86-64

vpython-7.4.2-cp27-cp27m-win32.whl (4.0 MB view details)

Uploaded CPython 2.7mWindows x86

File details

Details for the file vpython-7.4.2.tar.gz.

File metadata

  • Download URL: vpython-7.4.2.tar.gz
  • Upload date:
  • Size: 4.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for vpython-7.4.2.tar.gz
Algorithm Hash digest
SHA256 669569b2f92c421cb293b644611a3836f405d213e446b52033835a1928254faf
MD5 0dd6e97439c6169b30d75d04487cde90
BLAKE2b-256 494da64642ede4bb3dc686ac1d82b6136139973eef6aeb7e0ae8a8dc6856da28

See more details on using hashes here.

File details

Details for the file vpython-7.4.2-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for vpython-7.4.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 6f2c67ea8bec434c0d04b078247ad7b73aa6861442cb6fd03d47909a84f40f00
MD5 57268b3b54e3a25e06a70c3e500e36db
BLAKE2b-256 a32ceafcbd21004e00abe17f65c7f5b9ba6476cb09b859b44eeee1919a2a4cf0

See more details on using hashes here.

File details

Details for the file vpython-7.4.2-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for vpython-7.4.2-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 083b18b6cdacd4f6fcc92afe24ebc755d6ff77ac6202f2912a472e2ce5e72b3c
MD5 c826904dd1d949b28df1166312ce79ea
BLAKE2b-256 1ad916d3823dad413e2d886088d4f40137fa7a54eb816d5881172f74a8620467

See more details on using hashes here.

File details

Details for the file vpython-7.4.2-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for vpython-7.4.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 accf2650809658322a4bf1caa337c48611a7b7b8a69c3b9e1bcfa43b09463e56
MD5 4da8a3b2496a8df65cf27049f7f3962d
BLAKE2b-256 25ceb785f58f74356a965928faada1a21a12ea186e22ad86eaace41b798baafc

See more details on using hashes here.

File details

Details for the file vpython-7.4.2-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for vpython-7.4.2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 e0a254a64d1d1cc4830f9f6429cd35d18f3861e20b4678a00efa62aafa426323
MD5 abbf398b39c6eec4b359a2ecf171e891
BLAKE2b-256 073a84e019877bdf5a84b914a9962aec240b6715acc472e82d4902b6302c90ba

See more details on using hashes here.

File details

Details for the file vpython-7.4.2-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for vpython-7.4.2-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 fc7121402e9a7708faa4222c9c814cd6066638fe6a48f13a6b27008b921184c9
MD5 829e58adb0f43c74d2a227086f6dff68
BLAKE2b-256 73272e18628a7b15acefc1892089c47d0b1dd62a89133645981edbf522707995

See more details on using hashes here.

File details

Details for the file vpython-7.4.2-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for vpython-7.4.2-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 53195f6c2ba7eb59f2bf164823c9f4ee9f72c1803f26b185c7523e2d3490f68e
MD5 cf9e62113fed2099403f07b3073d3dbe
BLAKE2b-256 b3d36d7b2eaa57d632a29ce58b50148a5180758322de1b2b17c18891debe725a

See more details on using hashes here.

File details

Details for the file vpython-7.4.2-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for vpython-7.4.2-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 8aedc535d4b04fc6874c63eefaf928e3df8a1e9bc42eabcf9a9402c22583ccb3
MD5 c05f093b7d4a36f0a04aacc16702859b
BLAKE2b-256 96e258e9ea3dd8bffca2e88d48f753f9d24129ffcf19eac0cdd7adde5404cc8d

See more details on using hashes here.

File details

Details for the file vpython-7.4.2-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for vpython-7.4.2-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 52f17c1d97484cb16d4d471944a5021c119bcbed8fa70acab1777d92faefc268
MD5 d3394c66ad95fdd4424144b2ed2d2a1b
BLAKE2b-256 ba2327e0ac1a4187c02e1cba2dff98b8d9f5fecabb3a8e1b91f5b61f8847c0f5

See more details on using hashes here.

Supported by

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