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

Uploaded Source

Built Distributions

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

Uploaded Egg

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.7mmacOS 10.7+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6mmacOS 10.7+ x86-64

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

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

File metadata

  • Download URL: vpython-7.5.0a2.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.0a2.tar.gz
Algorithm Hash digest
SHA256 8b19689da2e827ddbb3539f0d8854a53cd03476e877ed5fa5072eb68a9c7f896
MD5 61f6461473cfc262e71492aa0a629922
BLAKE2b-256 75e22f7cf7ce8b35c84310bbf2e9656dbd6564e3400b1c4c5086fa44d97d523f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a2-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.0a2-py3.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 46e3e3c998b22614a7b155c072ffaa73e2990739233f02a9d91a99ae7ece3352
MD5 b3b9f489c586fbfa97aa2a7cef145333
BLAKE2b-256 0fb8ea7826c52fd550e0ddf6e8f13a2fb0d485015fdda227cc155dbec19ac3c5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a2-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.0a2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 36c2d8e84738eee631d1da6cc15a69cdcdc4874e840958f6fb03bb25defb594e
MD5 6c9ee4c43f00a346933bf9fb9a7a09d2
BLAKE2b-256 5472a5322a5d66717314d47b98b15391bbf61c7200d17e381603d8f8271184ae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a2-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.0a2-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 663e2866ab7006802bc3330289eead238039b6f22fb8342b18623b971e3c1d7a
MD5 76a82fd2047ff635e99025998c90a5a4
BLAKE2b-256 76ceb065c24fddc423ffae4721e3d275ef0b4c5608d202d602883af815784b44

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a2-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.0a2-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 2ccc6afac481560179eed7a0a33ea639916883ec391b964841fe066db9bafa91
MD5 cb8c0de206392f9fdbf4709bb155e0c1
BLAKE2b-256 a957249524528a08f1b5b74a2e3d2733faac30ba38072e4fa9689b3653001d1f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a2-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.0a2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 394e3af3027ba9970e9d723a4b70b841ff4fac4d2fc765f73ac010a6a84e124a
MD5 c0a2e0bd1c7ab441c065d4787cb09d6f
BLAKE2b-256 56508987366880414f6eb6cb3289f54ee25edfe1d216c90a3d212d6e63fa02ff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a2-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.0a2-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 54ce0ff570040bcbd9ea0b53a8ae1248afd4f3234838dc3c527669f5c9d602af
MD5 bb3b43a2972ec2a208d70971f7a85fe4
BLAKE2b-256 23d385486dabef102087432e29e3ae3812d79b345a90b8ea2a807e7ff76e3d19

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a2-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.0a2-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 308f12e85116a216967b6a57dad0888ca2b0362a095ecb1b23d08ee9d6097201
MD5 ae063d1bdf47f03d737462026f808500
BLAKE2b-256 886ae06183b919496c0949107e157a5d54f90b63bf0be5d5df33674a00048566

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a2-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.0a2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 28635f69ae6b4dc3e9d9b6ad68e975b25ae77d55f4528905529fd12ad5430707
MD5 9ab7d41e9ef122dabfd4bfe7aabac985
BLAKE2b-256 fd4a735aef3dbe52fe54e76bd0479d29f4f58a0dd540bdb67e3692e677c1c14f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a2-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.0a2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 2ef4153e4380e5fddba310cb3693e3544681bd7a80da78e09978d10a6786089f
MD5 9e56da2b2c884434bd7b2563a8541b02
BLAKE2b-256 38eee9c78690506f8e5b1d22b13f5cfc2aff19e15d690f96745437874d66c42c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0a2-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.0a2-cp35-cp35m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 19cf6ae2a664fa9964f6f1d9b9cca4b5c8486c360f3f8f140f5dcbae591a4304
MD5 a17ec2642ad703bf0a4c5f568b19c200
BLAKE2b-256 db369470ddb9c16136896e82435870aadd1c14367a3a08a4afe6b274ec509769

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