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.
Shift-drag to pan left/right and up/down.
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.4.7?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.5.0a3.tar.gz (3.6 MB view details)

Uploaded Source

Built Distributions

vpython-7.5.0a3-py3.7-linux-x86_64.egg (3.8 MB view details)

Uploaded Egg

vpython-7.5.0a3-cp37-cp37m-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.7mWindows x86-64

vpython-7.5.0a3-cp37-cp37m-win32.whl (3.6 MB view details)

Uploaded CPython 3.7mWindows x86

vpython-7.5.0a3-cp37-cp37m-macosx_10_7_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.7mmacOS 10.7+ x86-64

vpython-7.5.0a3-cp36-cp36m-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.6mWindows x86-64

vpython-7.5.0a3-cp36-cp36m-win32.whl (3.6 MB view details)

Uploaded CPython 3.6mWindows x86

vpython-7.5.0a3-cp36-cp36m-macosx_10_7_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.6mmacOS 10.7+ x86-64

vpython-7.5.0a3-cp35-cp35m-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.5mWindows x86-64

vpython-7.5.0a3-cp35-cp35m-win32.whl (3.6 MB view details)

Uploaded CPython 3.5mWindows x86

vpython-7.5.0a3-cp35-cp35m-macosx_10_6_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.5mmacOS 10.6+ x86-64

File details

Details for the file vpython-7.5.0a3.tar.gz.

File metadata

  • Download URL: vpython-7.5.0a3.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0a3.tar.gz
Algorithm Hash digest
SHA256 69a5dcbb0e832d059285f5a8ee0675d897052b76333ef659a0ab86284a5d4a67
MD5 629c11fe4256d33d4953f1c671ea0498
BLAKE2b-256 29bf5a24818d2117a73b88c68810bd6e69397266688baab2a7e3fa235de588e9

See more details on using hashes here.

File details

Details for the file vpython-7.5.0a3-py3.7-linux-x86_64.egg.

File metadata

  • Download URL: vpython-7.5.0a3-py3.7-linux-x86_64.egg
  • Upload date:
  • Size: 3.8 MB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0a3-py3.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 b8726c5679330bffb7f55b9f5be8093a69ebcb3e6fddb4f6b48832b864b9a7ba
MD5 3c4563893ee0fbd3936f593683e553b3
BLAKE2b-256 33b4204fd9b75c30efe4892b3a41b585da2280ad8eaca6fbd5a93d9df1eac4a5

See more details on using hashes here.

File details

Details for the file vpython-7.5.0a3-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: vpython-7.5.0a3-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for vpython-7.5.0a3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 81098271ce17fcc8ba0a4a2a8beb365f8ed47e06edc1effdc8d30188d1091dae
MD5 8f70b86e3ff7bdbd9d37e2d3f2b52182
BLAKE2b-256 8b018e492471c6c5b3b10c71169090e14dd16241de108d6f276bfe92d1c37fb0

See more details on using hashes here.

File details

Details for the file vpython-7.5.0a3-cp37-cp37m-win32.whl.

File metadata

  • Download URL: vpython-7.5.0a3-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for vpython-7.5.0a3-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 2cce6c173a0aca89f87f40287b93e566b30164a41375338e523500fd9c498d60
MD5 9222e9d5ceef2c75b8885eb70214af93
BLAKE2b-256 7259193d3d6975fbb0dbed5d49334daf8a97818e9e0477f9d5d19ad334f20a64

See more details on using hashes here.

File details

Details for the file vpython-7.5.0a3-cp37-cp37m-macosx_10_7_x86_64.whl.

File metadata

  • Download URL: vpython-7.5.0a3-cp37-cp37m-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.7m, macOS 10.7+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0a3-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 ac63a7855ff3051ac39ea5471e2c6eef6bdf95a19b6545ecc2a4666ad19b0150
MD5 c93387047bf35c4a7fd08db6fa79da0d
BLAKE2b-256 fdbfbe30a3804d73a3d7723ecb41a7431559c0f3ce73ef19dcf47d6a2ca6de33

See more details on using hashes here.

File details

Details for the file vpython-7.5.0a3-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: vpython-7.5.0a3-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for vpython-7.5.0a3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 7cc077d1330d038e96d2ac277f48144836460793dfc9ef7928741f32eef3fb19
MD5 034de5600d9a3b430f478c07dc0dbc36
BLAKE2b-256 9cc84c37a37394c77b2c390f33e26ac030ba021c2a9aee3e5706606616197f96

See more details on using hashes here.

File details

Details for the file vpython-7.5.0a3-cp36-cp36m-win32.whl.

File metadata

  • Download URL: vpython-7.5.0a3-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for vpython-7.5.0a3-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 573a2c192485c1e0e42fab1847202fb73ab2285dfbd8c1c1926cb5e31199e176
MD5 2461d62c9193ed2b9ae1c89e987bd80c
BLAKE2b-256 22f088a4b3d2f81ff0746f2ccb7ca36ae85a5b6bb9467900708cb1d54f74da47

See more details on using hashes here.

File details

Details for the file vpython-7.5.0a3-cp36-cp36m-macosx_10_7_x86_64.whl.

File metadata

  • Download URL: vpython-7.5.0a3-cp36-cp36m-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.6m, macOS 10.7+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0a3-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 7e0282f60a58f6f8f9f8bbecaaa9a14b19ebfbb83c65de7213f5ff6dad9b211f
MD5 f2dba44dbc7966ad0632e062e59ebf0f
BLAKE2b-256 d7806640712fa7f0441d522f454e8c283fe29a7c3b00c91bc641fb080d3fb1e4

See more details on using hashes here.

File details

Details for the file vpython-7.5.0a3-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: vpython-7.5.0a3-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.14.2 setuptools/27.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.5.2

File hashes

Hashes for vpython-7.5.0a3-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 6a3d96a58fcb616c103d82683eb8a19cd6902e66de4ef7c45cbb3105007981e9
MD5 65b79d737d82721883910ca592e7896d
BLAKE2b-256 8af23c004905eddded7d5b1c601c57f52a1fce8244758f62fd32cd60c8e0d438

See more details on using hashes here.

File details

Details for the file vpython-7.5.0a3-cp35-cp35m-win32.whl.

File metadata

  • Download URL: vpython-7.5.0a3-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.14.2 setuptools/27.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.5.2

File hashes

Hashes for vpython-7.5.0a3-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 a360fe7886f163ab07265ed084e95a11449d7098d8f1a362502b5e868694d210
MD5 af78beceb12749d352f1997f5c1b62d2
BLAKE2b-256 7516046b7fcc7d5637160ef99d7a7b4fde46f9829c4d10af3ad8a33495fa759d

See more details on using hashes here.

File details

Details for the file vpython-7.5.0a3-cp35-cp35m-macosx_10_6_x86_64.whl.

File metadata

  • Download URL: vpython-7.5.0a3-cp35-cp35m-macosx_10_6_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.5m, macOS 10.6+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0a3-cp35-cp35m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 49004b1ee0a4239bfa7c8a5c51bd2244535f0185f163895e00a9c87a0997df7f
MD5 339b59062bf8d837ae3708f328f5632f
BLAKE2b-256 214f18feed9fe9efe255da49635767fe87fbe28440823cd585a8181464ee85e3

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