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 https://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,
Matt Craig, and Bruce Sherwood are assisting in its further development.

## Installation

For more detailed instructions on how to install vpython, see https://vpython.org, where you will also find a link to the VPython forum, which is a good 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 in a Jupyter notebook 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

This version

7.5.0

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

Uploaded Source

Built Distributions

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

Uploaded Egg

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.7mmacOS 10.7+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6mmacOS 10.7+ x86-64

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

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

File metadata

  • Download URL: vpython-7.5.0.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0.tar.gz
Algorithm Hash digest
SHA256 922b636a56de9780585f56adc51268a289620da0634630d317ff8cc3195c0ed4
MD5 d13a3ac84d8602a050ff36cf020cc58d
BLAKE2b-256 c61af9f014509f9ff3ab764369f64b299bb6cac900bcec221ef531cc7c92176a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0-py3.7-linux-x86_64.egg
  • Upload date:
  • Size: 3.8 MB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0-py3.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 bd96e70f2fda600826b87b903a01d54ee5f8734279af783bb9cf9668c6328938
MD5 016f2d36e3e10b1bea5e140609be58e4
BLAKE2b-256 6933f9fae685563f3bfe59a2cd63919d390a1f4c07c712df429499f852c0035d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0-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.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 80123d98bff63d3769e84ae16c0d209864ef16d707d0c92905ec67f62a13a15b
MD5 4689f773a896958c31b9e0fbd8ccaa43
BLAKE2b-256 f46b6a31b52ac777e8b0d231d04f7d58392db9289e8a4bd5126195428f01a83a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0-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.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 7af52a6a72ad8dca6fa76dfdbf852e8065d5452bb7742e80cc14e78a9cb537f6
MD5 32f110d8de70b220e2c4c7625474dd11
BLAKE2b-256 f00433079bd9a4ab4cea2e37b8da678c51d8f3821e8403b652f2c2e4335438d1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vpython-7.5.0-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 a9f323e57a85be7d1df3526222b8632a8016a7cff72afd7fe44b18799d17f36a
MD5 51f293b52a67065baf809af1cf4db115
BLAKE2b-256 cded0d0283e449618f143a2fe3f7ddf8e1e4b36028cc953b5e3540b2fa5028a5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0-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.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for vpython-7.5.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 161aef7922c36b77104ec1e6d790d8f026a2b6c62f82a99761317a84b469aa78
MD5 02f0722a3e60add10f539926b19d4a00
BLAKE2b-256 d11f705e77a577e945ad47289639a6f68173b38e3aa2d851268c8993b732692e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0-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.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for vpython-7.5.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 29e33b5ca3d7de36148f35704875f928a6d07a3035e0922a0fc5e35140bcdf0e
MD5 e91ae466ba572c3aead66a25f2e907ef
BLAKE2b-256 053e7cc1af55cfd90aa6763b85d23b8ad128e096a249978d6e9fcf572b813739

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vpython-7.5.0-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 6422f79354267ddf518e38d8acd510344597f18bb0515f73e4df34d8f9f5c06a
MD5 fc04569d7255ab52b3190fad06e65acf
BLAKE2b-256 8d3f50ddd6655483cc4907e86c174b1ab0ffe371e06766e9466f71e5a4e21a77

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vpython-7.5.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 9a6e2e81a59236e9a340fc0e9c12979b24fb3a858db993b5014a9c0b79ffac6a
MD5 ce3f313d2c25e32734033e7d8a1cf7ea
BLAKE2b-256 7b13f9012409d22c641e7d7505b88e04f2806a631fccf7a702ccd01d67c1df81

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vpython-7.5.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 014e6ecf7d8b3d9627de6ad9fd4c6d19cc3f42ab97f2e229bc26afa439f2bba3
MD5 74246f9dea78cdfd6fbe486c383d9513
BLAKE2b-256 da2f2392672c6d62e294e115b0a1007cd9a813df7d353c38c13f4243c02b8db9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vpython-7.5.0-cp35-cp35m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 f43308b35646c1b1bc40e8da0f2001dae82a5be82376960660dd838990d551ad
MD5 b8b8cc1ebb961d45c15d29808a1fe600
BLAKE2b-256 96a7fd4c4aa13a17b13ba6a61f67e2df7b292aa79b17d2042a853fc7d549f785

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