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 --upgrade su-stdlibs-python

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.3.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

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

su_stdlibs_python-0.0.3-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file su_stdlibs_python-0.0.3.tar.gz.

File metadata

  • Download URL: su_stdlibs_python-0.0.3.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for su_stdlibs_python-0.0.3.tar.gz
Algorithm Hash digest
SHA256 fb9a39dab413cda24135d6e62319b9765c3752307238498ee99ed8adb1eb0e25
MD5 97e8d77749a84fb7c2c83563e63c51cd
BLAKE2b-256 36cd8dcd3edfe863ac1c1ad1e89198fae14d66c325bd8d8ec868030bedf20e54

See more details on using hashes here.

File details

Details for the file su_stdlibs_python-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for su_stdlibs_python-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 005ca4e9604524b3417fed5302e7a15d8d137a9f2379eb9b7975ef0aa1b10b0f
MD5 9124d3415604c96bf6e5593b545fbb86
BLAKE2b-256 7b6107219d6a93b07cfe21db76f5ddd161df9bcaf9d329efeab99a0260288d0e

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