Skip to main content

A marriage of Jupyter and the pyglet game programming library

Project description

Jupylet

jupylet is the marriage of Jupyter and the pyglet game programming library. It is intended for two types of audiences:

  • Kids and their parents interested in learning to program,
  • Researchers and students of deep reinforcement learning.

A Jupyter notebook is in essence a laboratory for programming. It is the ideal environment for playing around with code, experimenting, and exploring ideas. It is used by professional machine learning scientists who come every day to play at work, so why not by kids?

pyglet is a powerful game programming library. It is wonderfully easy to use for creating simple 2D games, and since it is built on top of OpenGL it is powerfull enough for creating 3D engines if you really want to. The sky is the limit really.

By marrying Jupyter and pyglet, you get the best of both worlds. Learn to program by creating games interactively. Watch the game change as you type new code. Change a variable or a function and the game will be affected immediately.

jupylet is also a tool for reinforcement learning research and development. It is easy to use to create novel environments in which to experiment with reinforcement learning algorithms, and it can render thousands of frames per second. Head to examples/pong-RL.ipynb to see how to programmatically control and render a 2-player version of pong.

Requirements

jupylet should run on Python 3.4+ on Windows, Mac, and Linux.

How to Install

If you are new to Python, I strongly recommend that you install and use the Miniconda Python distribution. Download and run the 64-bit installer and stick to the default install options.

Once Miniconda is installed start a Miniconda Prompt. To do this on Windows click the Windows key, search for "Miniconda Prompt", and click it. This should open a small dark window that programmers call console or shell in which you can enter commands and run programs.

To run jupylet first install it with:

pip install jupylet

Next, download the jupylet archive or use git to clone this repository with:

git clone https://github.com/nir/jupylet.git

Then enter the jupylet/examples/ folder and start a jupyter notebook with:

jupyter notebook spaceship.ipynb

Run the notebook and a game canvas should appear with the spaceship example:

You can run essentially the same code from the console with:

python spaceship.py

The only difference in the code is that the application object is instantiated with:

app = App(mode='window')

Documentation

In terms of its interface jupylet introduces only minor additions and modifications to the underlying pyglet library. Therefore the bulk of learning to use it is covered by the pyglet documentation. I have started writing a guide and will add documentation in the comming days; in the mean time head to the spaceship.ipynb example to get started.

Contact

For questions and feedback send an email to Nir Aides.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for jupylet, version 0.6.4
Filename, size File type Python version Upload date Hashes
Filename, size jupylet-0.6.4.tar.gz (19.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page