Skip to main content

A simple graphics library for INF100 at the University of Bergen.

Project description

UiB INF100 Graphics

For sample usage, see the docs on the simple, event_app and helpers subpackages, as well as the provided examples.

About

UiB INF100 Graphics is a framework creating graphics and interactive applications for new beginners in programming. It consists of two subpackages:

  • basic, which is intended for the first few weeks of an introductory course. This package let us create images and animations in a desktop frame with a simple, iterative programming paradigm.
  • event_app, which is intended for creating a first interactive, graphical desktop application.

Note that the simple subpackage and the event_app subpackage are not designed be used simultaneously.

For teachers: this framework is a wrapper around a Canvas object from Python's tkinter, designed to simplify the framework with these principles in mind:

  • creative learning: allow users to be creative with programming as early as possible.
  • authenticity: functions are named and behave (as far as possible) the same as for a true tkinter canvas. This gives an authentic experience and seamless transition to the more advanced framework later.
  • classes come later: knowing the object-oriented programming paradigm is not neccessary in order to use the framework.
  • the basic package is made for a purely iterative experience; similar to the turtle package.
  • the event_app package is for creating interactive applications using an event-based paradigm. It designed to enforce the use of model-view-controller.

Installation

Prerequisites

Python 3.10 or above, in an installation that includes Tkinter. Note that the standard installer downloaded from python.org includes this by default, whereas some installers that are provided by package managers such as homebrew and apt-get does not, and Tkinter then needs to be installed separately.

For Linux users only, the package pyscreenshot must be installed for all features to work.

Installation with pip through the Terminal

  1. Ensure your Python version is version 3.10 or higher. The command
python --version

should print "Python 3.10.4" or something similar. As long as it is 3.10 or higher, you're ok. If it does not immediately work, you may also try to replace "python" with python3 or simply py (if so, you must make the same replacement for the commands below).

  1. Ensure you are using an updated version of pip. Run
python -m pip install --upgrade pip
  1. Install uib-inf100-graphics
python -m pip install uib-inf100-graphics

Alternative installation by running a Python script

Copy and paste the following code into a python file, and then run it.

import sys
from subprocess import run

package_name = "uib-inf100-graphics"

if ((sys.version_info[0] != 3) or (sys.version_info[1] < 10)):
    raise Exception(f"{package_name} requires Python 3.10 or later. "
            + "Your current version is: "
            + f"{sys.version_info[0]}.{sys.version_info[1]}")

ans = input(f"\n\nType 'yes' to install {package_name}: ")
if ((ans.lower() == "yes") or (ans.lower() == "y")):
    print()
    cmd_pip_update = f"{sys.executable} -m pip install --upgrade pip"
    print(f"Attempting to update pip with command: {cmd_pip_update}")
    run(cmd_pip_update.split())
    
    print()
    cmd_install = f"{sys.executable} -m pip install {package_name}"
    print(f"Attempting to install {package_name} with command: {cmd_install}")
    run(cmd_install.split())
else:
    print(f"Did not attempt to install {package_name} now")
print("\n")

Project details


Download files

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

Source Distribution

uib_inf100_graphics-0.4.0.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uib_inf100_graphics-0.4.0-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file uib_inf100_graphics-0.4.0.tar.gz.

File metadata

  • Download URL: uib_inf100_graphics-0.4.0.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for uib_inf100_graphics-0.4.0.tar.gz
Algorithm Hash digest
SHA256 0e2c275e99c954760699d46bd210619ea1585ce05ad5ce24b9c967c63042d302
MD5 d03bd63e367550c19a590938f3e61776
BLAKE2b-256 739d894eaae3ba740b066c6acab65745d7f9094b7b0e48e1621ce4ac90ff27b7

See more details on using hashes here.

File details

Details for the file uib_inf100_graphics-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for uib_inf100_graphics-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 35bca42373bf23b10c7637709407d8542663a592005edbcae2b1f1ba725f4579
MD5 77c92268c3a14d6a709c073299aed627
BLAKE2b-256 487575f15a2a931e2d294f4c0cf57c9b78a718d0172d74c34fc53c80123c4872

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page