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.1

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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

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

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4mWindows x86

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

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7mWindows x86

File details

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

File metadata

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

File hashes

Hashes for vpython-7.4.1.tar.gz
Algorithm Hash digest
SHA256 1eb58bc6a24f77ea4f722880981bba15410a037aa64af07739464ae2545811c8
MD5 1e1cad29673f7b4d071cc2860c7d3ff5
BLAKE2b-256 cc6264ea99ac1b9b1f86516eaf3375e91d3c712121e14a4302cd995de97c4ee7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vpython-7.4.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 327427eef5cf4170c1bf586629b755f463ff241cccc2e912f1e6875c903a19f2
MD5 30ab10eaf6639d1773b8dc3c17b487d1
BLAKE2b-256 cda52b397b17010b7a5fc03c7b47f36b2a1468aae5d8d0d4bfa5c429948c8426

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vpython-7.4.1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 b1fead04b1f07ba63e7a26b9154864be2f7dfc2ea268676b9000d6005af2b390
MD5 3b223006b83bf6a74fe5804259c32dfe
BLAKE2b-256 92aa30bae4166c5ab8775a0b7190b4d3b454a7288d8b25044be00cc552be88f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vpython-7.4.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 4ab99883d19f33fffea571028ad3c647718f567181c00bb0f600de1757b94765
MD5 9c06ae5b0c2e41d1d0010694ea632fe2
BLAKE2b-256 47ef5cc21f3d602b61b556bf40991f6128eb3e86bc9266364c00bf7f5d422b6b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vpython-7.4.1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 62ffb4d11021e5e5f299293eb9cfc1150f5e4172bb2ddd6d55d8ec731112ce22
MD5 b923d6b45aff4e897df81fd027566321
BLAKE2b-256 fdf91e3eee9893804eac04e536583b2aa9d76842e6d5115c973b0b83322dca9a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vpython-7.4.1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 d0755f2391deb5de93b38875a64d6fb78cdc4310884d63dd73579d257896ed09
MD5 5cfd1df44e74bd57b3da4d85ae72346a
BLAKE2b-256 de8350896d1798660057f3f077f20b29355545b671dd489b992803f1621b5034

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vpython-7.4.1-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 37d67135260e857ca46781834fdcad79616acd338dca66b3e20ec3269ee7fc2c
MD5 2caf2b1b6cd043b0b389561469628449
BLAKE2b-256 88d35d06213797038ecfcb9db7897d45eca81db69cd4cbc83565a7e2d31494d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vpython-7.4.1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 8239428e41272a719680d7bc5892e8318361ef80b48c45fabc9f2322337d51fa
MD5 0e0c8485e7ae743d24e05850d28b2a09
BLAKE2b-256 dea6e6c97b5b859bb684968b22933270313b6925f84d3580288a0da283de68ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vpython-7.4.1-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 ca5f8335767b5e7761fb6b08a123d05f923cb4740639d800c08f2dfb66798818
MD5 5f5b60e790180cba92c7e5020fc5a8dd
BLAKE2b-256 fe86ba6b5072387eb9a474c3ad874b169992e7b8bbeefb50f0fbd33694ae9a01

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