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 https://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,
Matt Craig, and Bruce Sherwood are assisting in its further development.

## Installation

For more detailed instructions on how to install vpython, see https://vpython.org, where you will also find a link to the VPython forum, which is a good 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 in a Jupyter notebook 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.0b2.tar.gz (3.6 MB view details)

Uploaded Source

Built Distributions

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

Uploaded Egg

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.7mmacOS 10.7+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6mmacOS 10.7+ x86-64

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

vpython-7.5.0b2-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.0b2.tar.gz.

File metadata

  • Download URL: vpython-7.5.0b2.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0b2.tar.gz
Algorithm Hash digest
SHA256 84178f96276d47f4cd5afbab016db130b529fe603cf3b1644e6922f60175656c
MD5 5c4d747f6faa4d6c8ae1069dcf5a359e
BLAKE2b-256 35ea7e05c045f5db2d31d30f6896aa97b2bfcdee3ff5ab300726a717d280e775

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b2-py3.7-linux-x86_64.egg
  • Upload date:
  • Size: 3.8 MB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0b2-py3.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 618fab87425da3d4a729a6fe841fb32e0979ee5fd5ec33605fb9500dfb5b0e25
MD5 6ec8ad58b09919c041e416c6f51b785e
BLAKE2b-256 7c462ab87343ef629703470321e525260ac390af3d12291f4cd907df0f90a132

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b2-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.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0b2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 3c87de17f24b60790b604d9d44fb39269d5cc9c832ac88b7ea3104e04e70d8b9
MD5 34f0b12fa1ca141938e156306485cf16
BLAKE2b-256 b4831746ae64660513deb618c9eedbdd5c4d3c4385b8d53bb69a40d078da7b56

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b2-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.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0b2-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 8ac42b0797f210bff0a7dcdfa9ebcfd8e983d416c49fac0bade61c6364012cda
MD5 9c4a46481e4c627020469b2aaa25feb1
BLAKE2b-256 92f76ba68b09aee87c0b46aaacaa1ed95647cf4e5e29dd3b671012d92bfad9b8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b2-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.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0b2-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 71d0f4179ea09faa5314753d9183425f3a8b6e7d8495fa9969e198edf60ad2d5
MD5 9099f3a4f2fa5e45e5b102bcce5c14b2
BLAKE2b-256 c54aa86b7ebec9c978364973008dce4cad91af26c2d9d05ab5f082b1f9d2ea58

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b2-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.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for vpython-7.5.0b2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 3cdeaa9c2250e98ee50301a3f854652774823f32405516305c46211651218445
MD5 f2fe14aa494285c1c32bf22ae64b232c
BLAKE2b-256 1d95b2de7aae1bf6bd7d2caebd27d1394e4544eba4c73cc29adaf3558092f5c9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b2-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.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for vpython-7.5.0b2-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 f3c124b1c6aadd6ffd8dc812565f092723a1c7e8800003ff8813f5b70caeeab1
MD5 84ecf10dc5a50cb58f7b816f6aded34d
BLAKE2b-256 5484622a61a29510eb00432020da3550ff1b3211c89657d405d074b909afd0fc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b2-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.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0b2-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 381ce7bc7193c362f87cc647eb26958ef59b31cb7dc98ea56304cb75ee5ff75d
MD5 4515d04a69ab4fdc5a796e0236c2d0e5
BLAKE2b-256 519f8491cbff855bcccefdc10a4aba2370f0a54eff85cca3a45101634067a8b2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b2-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.13.0 pkginfo/1.4.2 requests/2.14.2 setuptools/27.2.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.5.2

File hashes

Hashes for vpython-7.5.0b2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 60c082d6056574f0ab1072838512ec40e3c8829fc70bd6ce2c6899979fe61d11
MD5 a26cef8a18761482dd33217f74a25199
BLAKE2b-256 fc16a70cf8c9bd27d1ebe5787faa28a8bcf8088a64821f32f26048c2c6f67cac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b2-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.13.0 pkginfo/1.4.2 requests/2.14.2 setuptools/27.2.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.5.2

File hashes

Hashes for vpython-7.5.0b2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 f5c3103abd88d2f0cf2fa786b11e19491dd8a840610805b9128133a6773402d5
MD5 16b20f4b3f8319890d9d0ccde04d81d8
BLAKE2b-256 6e7596efeb7e7988d6354ee3b0fb7240e5d205b5af34fbbd1d2acb5a2aa42168

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b2-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.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0b2-cp35-cp35m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 4933e3fdb7f641ac42b209538cc581d59133585812085210805cbae8595127d0
MD5 7c72f87d376f3aff6367b55ae73911e8
BLAKE2b-256 5bbe0a3b37a3c21cf3f57be50bacfa4dc3b8615823010ddeb5244b594036d1fe

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