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

Uploaded Source

Built Distributions

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

Uploaded Egg

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.7mmacOS 10.7+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6mmacOS 10.7+ x86-64

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

File metadata

  • Download URL: vpython-7.5.0a4.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • 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.29.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0a4.tar.gz
Algorithm Hash digest
SHA256 87c6bc43c32b61f2c4410c0e4ead8f170fe4c0143ab3c2754cbf6fb5237332de
MD5 0db81ba3098c0d94bd9d11e5dcfb62e6
BLAKE2b-256 7f94aacc82f4094a33596fb584da4133c248d5d12e7b997d8e87a817500fdeb0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vpython-7.5.0a4-py3.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 8a9ce3d09f400cf04aa7ce037eb160ed9e974671a65f8388b5c44c303c91cee6
MD5 ef4b08bfb0ee07d1ccdb4c8f0917ec14
BLAKE2b-256 edf43c333f6e18d40f537529ff17982c3f2e9c61fe43a0d3506d369cc3384d90

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a4-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.5.0.1 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.0

File hashes

Hashes for vpython-7.5.0a4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 002ef1236383bc027cb428598732e1e9a4fd5929cd050a9cfdd7708986615d48
MD5 496e9220622655442feab14d74b09e5b
BLAKE2b-256 aef0a1b5d77264d612fc713c631d84900ebc123eb60a954e43b79fb87b1c80cd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a4-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.5.0.1 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.0

File hashes

Hashes for vpython-7.5.0a4-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 018392ab5ef75de65f8c3eb0d3d05c046bb8bad1c3492bde971dbeda4d9845b7
MD5 58d63685886a27064f2a90a848aabb2c
BLAKE2b-256 972c0003d789f82e80bfb05ced1260543cdcccf3b99b161cd4f22c4879087175

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a4-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.29.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0a4-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 efabd6be91d6e1c39084e342f711e29900e28c96c42b51a250c086d79ebbe6a2
MD5 8fc3677a2ac842d95386d2d490420bf0
BLAKE2b-256 52f1a7cd38a2bbb1c8a0facb91bfe7b5f3c8d6a15697db24cbf1707fe59c147d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a4-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.5.0.1 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.5

File hashes

Hashes for vpython-7.5.0a4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 33ea6fd91e0caf2d7348ec1e4745e75b1d1f7d7ed4df20f7bc977f2980b3e06a
MD5 4affe68ea1629b20f6c8c1c2e6fda947
BLAKE2b-256 58ce23da4c52262bd3990bbfcd63ea8a732efaff7bd92b42f1754aedacc332e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a4-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.5.0.1 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.5

File hashes

Hashes for vpython-7.5.0a4-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 484fc31467df40641715162f765b39a7e48b6ac6218660db5033b4836d53dde8
MD5 f947fb18789a4a8e2a5fd318a8eba190
BLAKE2b-256 d701569842b72a8803bf26ac195a11265e306be434436ec0dbfc61552a41f588

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a4-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.29.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0a4-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 73ecb854231ee3577526d080441b04054d0508604dd56b6666dabc29106a1a82
MD5 081d0120e1aaf810865dab67d51baa96
BLAKE2b-256 0da77f01f5bc40b6cac6d05c1344728f75ae07315556915bdfefb7fe9e68b252

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a4-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.29.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0a4-cp35-cp35m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 4a007a96e960f6b440a034771630ad49f73a5eae55c2c93a2d593ce35dea8e8e
MD5 3cf0308e2e78e35990f70b5b92fa1bfb
BLAKE2b-256 6283efdb76311b28792f0de450e01824e7c59f884a03803b26ccf0eab29406fd

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