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

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

Uploaded Source

Built Distributions

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

Uploaded Egg

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.7mmacOS 10.7+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6mmacOS 10.7+ x86-64

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

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

File metadata

  • Download URL: vpython-7.5.0b3.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.0b3.tar.gz
Algorithm Hash digest
SHA256 eed03ce406e789e3eeb1ea57c81473651fe18feef59d27b588a14e313dd698d5
MD5 e0e60ecdd34d7f273acfa35e5e144d7c
BLAKE2b-256 94b6510f7ff5a5ff31553c27f21874f9c47d53896ae77d21a8e2bd3caf53150c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b3-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.0b3-py3.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 11b404ad76ca48dd27f253a02641a1b238454f8da313b22f5c29fbe0322784ea
MD5 2d78236257a80bfb176d30f840a7de58
BLAKE2b-256 4b11a652a91d38fa07da8fb4d102c6f92f755c0d5fa72ca7fbcd6c378e7b0df5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b3-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.0b3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 f1644d0ec906009c2fcb99147c618d6f1e04080193a5c4911db3dbdb6a42eeb5
MD5 f79bcd4febe0b650921b6936216841ab
BLAKE2b-256 940db61b02dd86992a9cef66cc700ec3b076cf4efb8412f13b54f7108a074cd3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b3-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.0b3-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 2131d11053128ff64a1e26033f4efe5f2fa88c79f87206a156282e8fcb962e5f
MD5 e73cfcbc9fac8803671f4385f2cef827
BLAKE2b-256 d81dce1066da9a01f7e0105dc1a92e7950ba73b06351af63d2ce3867c9d66d1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b3-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.0b3-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 2f7c149d4953657847731264c361406b6dde8555c59bd19a19332473efa5d7f4
MD5 126aee19146e50bc7f110327b537412f
BLAKE2b-256 288f4196f1f7029f9bbbb63f4c3612a7639af221e735ee1e3987d38110a78bab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b3-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.0b3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 1f3737b4418f52cff3f682d105cd1c802d9574daaf54ace22f88beb3ded7f072
MD5 fa06b9265651159612bdebd8f38a1413
BLAKE2b-256 184b5625069747016d88b441cc1998615bff4dae5182918b89fdb088e6ad0c19

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b3-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.0b3-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 f7a72c6f7a570fd2c7fd0c5fc04a751695ead3945f628ac723eadf9e11b0ae28
MD5 9d1db8f4f984c8e8fcb1be1567db17f3
BLAKE2b-256 f6831eedf053b84afe7b5d9b0c58bf5a92b6ee379b2197179a7e966445412e93

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b3-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.0b3-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 591c62b0682d9e19fc25d5358b6581d333bfa73c9da653fd3a96de569f066853
MD5 bcd5fc1a9835eedf76057af5b4d2b5ab
BLAKE2b-256 699475ebd23e6b740aa343c235a1273ceff1ab38834f616b3d83f79bb6b7c23a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b3-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.0b3-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 d8110c3f72daf2b3ac1a43ed8c8137bb151f335e8aa0015968ee16fc56b36f8f
MD5 848800debffc2b34101b9e6d2b94aa94
BLAKE2b-256 992c83cf699b87b3509b7bbc401691cb3c0b947b31e85cef733b13f2add6546f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b3-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.0b3-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 68fa388fc27c0f252d1a9e77c8b52811d98f784bc99c160f6d69f3ea9ce4e5fd
MD5 203b7fda29a6d03df113d206dfee9840
BLAKE2b-256 76b6e6bbc4cf0677d1801209140b4a580938b6271bd8451786f1e631e1cb8b2e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b3-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.0b3-cp35-cp35m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 af62f47b33a48124ac78e6b8d93ab43fab2ae0eaa4018850d2c608d948d37071
MD5 ada9e5b4d404b8dd280f9dd2962b224a
BLAKE2b-256 5786c6db77f574d8f6283ffd1b73e292f15dc045f4b87d6f4f27fa0c39c3a6df

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