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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

vpython-7.4.3-cp36-cp36m-macosx_10_7_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.6mmacOS 10.7+ x86-64

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

vpython-7.4.3-cp35-cp35m-macosx_10_6_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.5mmacOS 10.6+ x86-64

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

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4mWindows x86

vpython-7.4.3-cp34-cp34m-macosx_10_6_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.4mmacOS 10.6+ x86-64

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

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7mWindows x86

vpython-7.4.3-cp27-cp27m-macosx_10_6_x86_64.whl (4.0 MB view details)

Uploaded CPython 2.7mmacOS 10.6+ x86-64

File details

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

File metadata

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

File hashes

Hashes for vpython-7.4.3.tar.gz
Algorithm Hash digest
SHA256 19e6e8ff59ff2de4e9c39599e06b51c7a8dedefaebf315311fd46ec7f8ad94b0
MD5 cd7844fc29ed96a12687cfa9317986bc
BLAKE2b-256 d9634eb7ac4f1e9bce03a7ce845b79a79ec1559d011f67a0e7549d512a47df85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vpython-7.4.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 51b109ec389dd5fe6cc5f1627ebe454e44e802db769fcdf014ef00ca138ae254
MD5 eeb7268746f92d043a4927ce474cca8a
BLAKE2b-256 192fb0a11b88c255b94551e320108ae85b0ad6e03d40ce084ea4aab5ca1f30d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vpython-7.4.3-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 3d905e473d3b81c1ce9ed5608fa3bc8c8496d98b05975da5c7ccb9f584e8fa9b
MD5 da155601842f43ab4cc9b796015e227d
BLAKE2b-256 6ac72f0ff99a9044aa4c3a3cdc8bdd11426230368ba4ea79cc6f4baff5e00aeb

See more details on using hashes here.

File details

Details for the file vpython-7.4.3-cp36-cp36m-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for vpython-7.4.3-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 a91484f217f278975eddd32f4ea8d90accddeb048876d1c85df3273d29b970b3
MD5 feec0b8ce544f17168a082d14b92be84
BLAKE2b-256 55b46dbc376289ff171da89c4f895ffaef7245b77def9441bd3ea8989b805990

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vpython-7.4.3-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 1d6275a2cd1eaa846a2a4203ee41c4e5cda4487a05b994ec704a5e71ad0a9863
MD5 418d74ec03ff7cf755e071c1ff417427
BLAKE2b-256 7e4418478190f3d7a3cdd1a09df67d38d150e6b4ff80cb04d14e8b5dde475afa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vpython-7.4.3-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 a5bb06b84d0fda172d1dfaa7ac621f97962e33035495add18a7ea7b8ea84fbe7
MD5 49b1e6402322cd39bf0c182e75cdfdbe
BLAKE2b-256 8582500c26f46881c43e86600a7de0fabdbab6abdff3f7a6ce1792d140df733a

See more details on using hashes here.

File details

Details for the file vpython-7.4.3-cp35-cp35m-macosx_10_6_x86_64.whl.

File metadata

File hashes

Hashes for vpython-7.4.3-cp35-cp35m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 3b92ab0782761c118741bcf154eeb045a9ab01e8542ec835ee5c4bebb8817c21
MD5 40ed26f4e9546479e3441b7f11523ad9
BLAKE2b-256 5d63f8467cc5a4d35258753cf0a230848e2dd0e9fe40eff42f64de4611ed0b2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vpython-7.4.3-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 6972734c27344b304225460cd25254dafe23f6dc783483fba28f769ea7ca3648
MD5 56e97fa39358a41f1717d0aff59d703f
BLAKE2b-256 e505c66e3a2a04d591371517348469d100f9ac8555219607fcf021b557239a12

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vpython-7.4.3-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 1a292da1db2b81140fb974dfff8071c29b230de0a8f59881adf1450b628ab8ac
MD5 c5ae126e32ab57e24e3cfcc7a32b447d
BLAKE2b-256 58e69b9e7a4bdc1570ff9855e68ec3309963bb74eb8ae9106798ac0937c3505e

See more details on using hashes here.

File details

Details for the file vpython-7.4.3-cp34-cp34m-macosx_10_6_x86_64.whl.

File metadata

File hashes

Hashes for vpython-7.4.3-cp34-cp34m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 ec20ce7d64c79a9a9dd540bdba8d3512417d61e05b1f22e5402ac25f85e1e34e
MD5 95c3754c95e3818547983500f93e8149
BLAKE2b-256 ddab01248af628040ff2e9cff907366847d3052eeaf6f824f88a6dc6c3f48e38

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vpython-7.4.3-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 2685f6a891e942e3b4fb44a59d0cd5c79a50072588af27408f45149cc162507a
MD5 77bef038c2521544fea924c6b1e8c7ad
BLAKE2b-256 d2c81ba6c0fa06984cc8def4d80cd462253958a69a9b19d69c1552880a9f4d9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vpython-7.4.3-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 c9e2795e1fd39872ba5c6c1798206fa8a930035d04fa50037a2753b4049dbf3f
MD5 80cf9f814c75ff56cce14312215689c0
BLAKE2b-256 5794a33646d7cbd1784a72a0357dd47fb47b7eb16e042d1db57190dbcdfb748a

See more details on using hashes here.

File details

Details for the file vpython-7.4.3-cp27-cp27m-macosx_10_6_x86_64.whl.

File metadata

File hashes

Hashes for vpython-7.4.3-cp27-cp27m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 6f369243ffd2147e455b6c2a9f879bc3d5d5846dbf5ad5953c1efddaa033a577
MD5 54e48d67e0f6f3e1015fe6635909c14a
BLAKE2b-256 f8337bfc9850ae92b86861c9acf19b9d3ee25b0ef296a5d782b3bf4b17fbd61c

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