Skip to main content

Stellenbosch University Python 3 code for "Introduction to Programming in Python, 1st Edition" by Sedgewick and Wayne

Project description

SU stdlibs for Python 3

su-stdlibs-python is an adapted version of the Python programs provided with the textbook Introduction to Programming in Python by Sedgewick, Wayne, and Dondero.

Target audience

su-stdlibs-python is intended for instructors and students who wish to follow the textbook Introduction to Programming in Python, 1st Edition by Sedgewick, Wayne, and Dondero. It was first created in 2023 by teaching assistants and instructors at Stellenbosch University.

Installation

This library requires a functioning Python 3 environment.

Some optional visual and auditory features depend on the numpy and pygame packages.

With pip

For Python versions 3.8 - 3.10, due to compatability infeasibilities, the current safest option is to install most requirements manually before installing this package.

python3 -m pip --upgrade pip
python3 -m pip --upgrade wheel
python3 -m pip --upgrade setuptools
python3 -m pip --upgrade numpy
python3 -m pip --upgrade pygame
python3 -m pip --upgrade mypy

After the above commands execute sucessfully, install su-stdlibs-python simply with

python3 -m pip install --user su-stdlibs-python

If you have already installed su-stdlibs-python and want to upgrade to a new version, run:

python3 -m pip install su-stdlibs-python --upgrade

To test that you have installed the library correctly, run this command:

python3 -c 'import stdio; stdio.write("Hello World!\n")'

It should greet you. If an error message appears instead, the library is not installed correctly.

Hello World

A simple program, stored as a file hello_world.py, looks like this:

import stdio

stdio.write("Hello World!\n")

It can be run with the command python3 hello_world.py.

How to suppress pygame import message

Windows

In the command line enter the following and hit enter:

set PYGAME_HIDE_SUPPORT_PROMPT="1"

Linux

In the terminal enter the following and hit enter:

export PYGAME_HIDE_SUPPORT_PROMPT=1

In-code

In your code add the following to the beginning of your code.

import os
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1'

import pygame  # it is important to import pygame directly after

Contributors

  • Marcel Dunaiski

License

This project is licensed. See the LICENSE file for details.

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

su-stdlibs-python-0.0.1.tar.gz (24.2 kB view hashes)

Uploaded Source

Built Distribution

su_stdlibs_python-0.0.1-py3-none-any.whl (23.9 kB view hashes)

Uploaded Python 3

Supported by

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