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

This version

7.4

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

Uploaded Source

Built Distributions

vpython-7.4-cp36-cp36m-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.6m Windows x86-64

vpython-7.4-cp36-cp36m-win32.whl (3.2 MB view details)

Uploaded CPython 3.6m Windows x86

vpython-7.4-cp35-cp35m-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.5m Windows x86-64

vpython-7.4-cp35-cp35m-win32.whl (3.2 MB view details)

Uploaded CPython 3.5m Windows x86

vpython-7.4-cp34-cp34m-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.4m Windows x86-64

vpython-7.4-cp34-cp34m-win32.whl (3.2 MB view details)

Uploaded CPython 3.4m Windows x86

vpython-7.4-cp27-cp27m-win_amd64.whl (3.3 MB view details)

Uploaded CPython 2.7m Windows x86-64

vpython-7.4-cp27-cp27m-win32.whl (3.2 MB view details)

Uploaded CPython 2.7m Windows x86

File details

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

File metadata

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

File hashes

Hashes for vpython-7.4.tar.gz
Algorithm Hash digest
SHA256 37791862562697bb397459ace211106898408e228cfbdc0f47ad5811307f3000
MD5 7f470799cf14758d774e455b2ecdf1f8
BLAKE2b-256 dda2eb3309e554c85cce82479993ee14a7fef9e1f07355a8542c2ac406f580b5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for vpython-7.4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 4f07e6d80032f26772bf68990369479b2d28e5f5e8c2c10f6d656df4ec669628
MD5 119584e8092f90ff743a3c15fc9e0aea
BLAKE2b-256 fb15fdecf4963fe180c3f76f08a6e033e73656cc3bf97fbf51e6b4ea5b32f3ac

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for vpython-7.4-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 6974f707d18c9d2ce02aed8a4581b3a0c0fb8e953ca2f0ba3736bb8562d99d79
MD5 ff0fb2c33fc123696bd36c6d39bef6f6
BLAKE2b-256 cfb4ce2b4c061e853ec136d167b07f20ba3117c78a58ce5ff5de4e57efc7e2b7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for vpython-7.4-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 8a09fca77f0a1618af7fe3a75175263b9b7c4d18785ec9924881001d80d5d676
MD5 295f69d47231132c5955ae27e2db2ba9
BLAKE2b-256 e99149982f198e10e79944a49b2b843982b2cb972d8838048eae51e71237ea32

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for vpython-7.4-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 37aa2b0aa967c5e07916f513840cc725a2bb73e84dedfa6c42f8e373845ccea7
MD5 07fa1563f98c5b4f1d4fe4fe19df78b8
BLAKE2b-256 18026123d3710592f271c38a8e8594a0565ad113a92cd38795320d396c56eaaf

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for vpython-7.4-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 3bde8be5c15c91d93502c1638a3700c1095ce16b580f762339f021d9705b0aa2
MD5 849fe919dfa179f879b5c372330abfae
BLAKE2b-256 201f0a409e1e95cc0d4cba83cb1c6cd640666d31f9709bf53ae49b5386334bf9

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for vpython-7.4-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 4242fcadd6f153348c132e49a10b0c134d51c5491fba1016a37c96a5d3a91802
MD5 012495073bf638c08918485e1e6102a6
BLAKE2b-256 2060ed033fe492ded095bd11a3a473df41908c7d40d48bbba4d0b11e0643d640

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for vpython-7.4-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 d3e0a65e8ca3eecb19f61cc655757a6ad25dccfc124cecf845c013a017bd9890
MD5 dbf44447dee919b92b785dc859434664
BLAKE2b-256 794818792a74e727ac57564c3a472e70adf9a8b12b23120668ba1044dcb020f3

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for vpython-7.4-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 18a8f6957a28d388f44462367af5ef0d0ac6ffed0602ee664ef281e598352d1f
MD5 8b233b837cfd961afa5676dab8d35e19
BLAKE2b-256 e84ee23d8e66dd2ead86f1a380ba06c8c76214b42445f6e0cd6db84778a003ac

See more details on using hashes here.

Provenance

Supported by

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