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

Uploaded Source

Built Distributions

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

Uploaded Egg

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.7mmacOS 10.7+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6mmacOS 10.7+ x86-64

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

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

File metadata

  • Download URL: vpython-7.5.0a1.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0a1.tar.gz
Algorithm Hash digest
SHA256 4888dbde8f03d5e065d85fd0c0a7990824bee994f3f0c8bfe9255621e48bc1c5
MD5 b5b3163e722345b1dd3b6c13d0f72bca
BLAKE2b-256 d9a1eace94122549eb4946d5b22ec413230cd90a74b0adaf686780e7ee561537

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vpython-7.5.0a1-py3.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 969e40d4fed55864688188116aaf5acad4ffec8e713baecb399be1c79997ecc0
MD5 121e63f0fa4ea34493c118ab450dcf70
BLAKE2b-256 63f91b3e5d36810fc7edfbc193827fb5ed475eee94d83812f075156c9544a023

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vpython-7.5.0a1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 4df2d35b13ac0d00b6bd22aaed192739c2c791cb6d7415733f2600f01732aae4
MD5 4e7f73616486661ccd0858143811e258
BLAKE2b-256 b2f89c8cdec145bdd37b012bbedb3193187de3a16761e0ae0ff408d016570106

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vpython-7.5.0a1-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 92729af2ad91fd603df9ee1cc674e401acd3b49d18589540262b4e74fed20d3b
MD5 e23b90375eeebef333a04f04eeb48cac
BLAKE2b-256 022118f3a68456b3187eb44de1b9e5424c9f90092bb4788ede70c4e80af873b7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vpython-7.5.0a1-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 8abe5fd8a3f84153556a6b695ba8aa051643c615c4e4994f9ae8b63e437f3fb3
MD5 80286da7239434c52b1a3c101c02a4a9
BLAKE2b-256 876a576ba8781a4239b407b30484bcb37975831ede220d27237637805a87f1f0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vpython-7.5.0a1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 f851dc5025ceaa37e67da888dfd9cadc3180e7eb15cfa8c2bae35d3373c33706
MD5 e22fe02686293b3d7cda7dfe7fc286fe
BLAKE2b-256 b147d78d2e11ee072777e249b640c7baf906f9c8cf60a42e4f1aabb239a826a3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vpython-7.5.0a1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 f36627a2be969abfb1bb9843655a0f7ff91ba3843959e1ff97c85be674a13ccb
MD5 31ef01e091da03a7d4a2b8e0ce1cb64a
BLAKE2b-256 5ea84551503995c92ac5e797359152d2af088b9737fa0ded3f681729a17f8313

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vpython-7.5.0a1-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 a0034ddd10a121d7cfc91fa2442e45ab6788307a2953279847af8206c44cee1f
MD5 d94bc8422b3e97c72c49e8a15ac6193f
BLAKE2b-256 0d96dff3cad1e0cdd6f8d64355a510d27c8c8f6102d5e6dcef60652c6290e9fd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vpython-7.5.0a1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 1971a4e69a45b8519517a407524e8686fcf74fc3cbd766df4e07992deda72b5d
MD5 041af5c325332198f5d3015583dab67d
BLAKE2b-256 c59bafc707ec62ebeba0c42c87b101777e50bdee3bb0fab19189360654e1c5a9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vpython-7.5.0a1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 46bea3a954a1e6d70349f1a1f9dd348958b8a996e3594bacca31ce2229bebcd3
MD5 353e76f4bedda4f4370ad5320adcfe2f
BLAKE2b-256 9dd13ff428720fe35c54d4b6ca43e27dfc17bcb2d1c3021fbd8c0f59f809c7e0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vpython-7.5.0a1-cp35-cp35m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 e62e079dfb677588f144dfd5fa077130815aed71300b9d2ed9daa21033dc8720
MD5 5c09548133806b873e9e27aaf973cc44
BLAKE2b-256 94a5284c9805afcbce4bbe4f2dbe083d786d53ad3a9e1a65aed67921bdb79fd1

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