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
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.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b9cc5b97988ed4d3963d14f40b6a8d4c2dbd5dd11216f8ca26b4792eb7d6aad |
|
MD5 | 82e31757ea22ad39c9091446adb55779 |
|
BLAKE2b-256 | 3147ca9c70c2c1faad9b9fa1b77c9a44375bd44d07eeb5a6ca937256bb07b8ca |