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
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
Built Distribution
Hashes for su_stdlibs_python-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 005ca4e9604524b3417fed5302e7a15d8d137a9f2379eb9b7975ef0aa1b10b0f |
|
MD5 | 9124d3415604c96bf6e5593b545fbb86 |
|
BLAKE2b-256 | 7b6107219d6a93b07cfe21db76f5ddd161df9bcaf9d329efeab99a0260288d0e |