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

Uploaded Source

Built Distributions

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

Uploaded Egg

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.7mmacOS 10.7+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6mmacOS 10.7+ x86-64

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

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

File metadata

  • Download URL: vpython-7.5.0b1.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.7.1 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0b1.tar.gz
Algorithm Hash digest
SHA256 399c8ca76f7d6acd59787b00ae91cbc163942a80a497411a00287fb05878cc48
MD5 d6cbb156557c847f126dfda2b08b94aa
BLAKE2b-256 a573ab21e3effade95b37805e79e9c652102ac7f9805cad6240f6fd43cf9926a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b1-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.7.1 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.1

File hashes

Hashes for vpython-7.5.0b1-py3.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 3ff33d069a9ffd02a63eb0c48d741e817f7873a8e6a6bd86c143022ba7fcd4c4
MD5 6518c0387eb44e280602c620b9d7959e
BLAKE2b-256 c5274b1acb316bfb424082b65fa4946086bbdbd5508497193f0bc8d861a26004

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b1-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.9.1 tqdm/4.29.1 CPython/3.7.0

File hashes

Hashes for vpython-7.5.0b1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 f93849571d277eca66d9c34b6bb095913f9eb515cc4b81175bd00826793a8bfc
MD5 4004b8d24898d0cb7df4bb7f2ad75c5c
BLAKE2b-256 94651c4cdb062506458fc21baf651527c831697ff51f36db8a17760d0321e6ca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b1-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.9.1 tqdm/4.29.1 CPython/3.7.0

File hashes

Hashes for vpython-7.5.0b1-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 2707e328c365328b486edb9e30c67e9e7a6147cd8aef9aaef8ecb49217349bae
MD5 f28c270e7c467a6deaacdf0c693e4df9
BLAKE2b-256 ecfe7657d88b4724f1947fafb0f1849502afbfee114dfd600ad8079ae50ba05b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b1-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.0b1-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 8d71248f8ce0cbe2e477bf98b203f24f80c4b15a074e45441d7be9b2b750189d
MD5 c0c4257ce5ab69f9923c8ba509a42e7b
BLAKE2b-256 c0afbe1e864d445feea236ce2c06bc7a2a9d6d96628ca183b04a2a6a023369ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b1-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.9.1 tqdm/4.29.1 CPython/3.6.5

File hashes

Hashes for vpython-7.5.0b1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 f3a286230cd02baf55d6b71dac96f37802e919c3f3d815e2cd9db014fd823080
MD5 343342401b8ac16c966bfd6a7b636b28
BLAKE2b-256 f6f306519114a76bfd36275d404f7d7392c7d1939c3ce9a077b755a4d340bdd6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b1-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.9.1 tqdm/4.29.1 CPython/3.6.5

File hashes

Hashes for vpython-7.5.0b1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 073529234bb0e0f7d2562398eda6810b5c30d1663f9c15ce00ff75e5378919cd
MD5 9e0a050dcf0df62cb309cd7fa5dd0143
BLAKE2b-256 dff8eeecc8f16dd5cd01de2f7b3d402c4e8f4a09d4a77e20fc210fec1d7950ba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b1-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.0b1-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 a9982a580899a7b76d6488f35868feb8ded0073eacb2addc38ca71b39a755946
MD5 2e8c30929bba54e59e871befcbeb8f2c
BLAKE2b-256 ad5993a8ba4ba869bbd35d5f53978b916fc7c8b30c3f3de4d702c672ea56b65c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b1-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.9.1 tqdm/4.26.0 CPython/3.5.2

File hashes

Hashes for vpython-7.5.0b1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 363979ae60b09722d566276e9b96b7caf22e73fc2cab7cb9cc4c12165a210163
MD5 7969b9fc6cc0d3e5678c1c324208c252
BLAKE2b-256 298f8a831c40165d81e93952b891566cde587abaf93b2459b2d3409f11cd12c0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b1-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.9.1 tqdm/4.26.0 CPython/3.5.2

File hashes

Hashes for vpython-7.5.0b1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 c9dc6abda038fca220c5b00bef4d44757ada50e9b9a2f09213a8b137b7b1fb1e
MD5 92fa3dbdd4b60f6cfe9ee7e60f9a82b6
BLAKE2b-256 e932edcf2d99a891838c7e0252bee269d531989914c910c3cf8eb7178572d737

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vpython-7.5.0b1-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.0b1-cp35-cp35m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 041e2983faba10063a32676a4c3c849a395d5e7108628964436f99264ea734fe
MD5 c4747ba2cdd5d2ea39526646d37abc8f
BLAKE2b-256 2d0016b0583f5e240f9a10bcbd045a794386d7d112aa98fdd2de3d2c1a8f4e79

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