Shim around PyGame to hide "Hello" message on import.
Project description
pygamesilent
Background
There is a mature open-source library for building multimedia applications, like games, called PyGame.
Unfortunately, in an effort to recuit more developers, the maintainers added some output to the library around version 1.9.4, so it now prints text similar to this upon import:
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
This move has been confusing (especially for user-facing command-line tools) and controversial but complaints about the behaviour have been dismissed.
Description
This package provides a shim around PyGame that turns off the unwanted printing behaviour with an environment variable. It is designed to be a simple drop in replacement wherever you would use PyGame.
There are manual alternatives which have the benefit of reducing an external dependency, but this is simpler:
- Install both
pygame
andpygamesilent
into your project. - Replace any instances of these types of statements:
import pygame
→import pygamesilent as pygame
import pygame as pg
→import pygamesilent as pg
import xxx from pygame
→import xxx from pygamesilent
Versions Supported
This is expected to be cross platform. It has been tested on Windows 10 and Linux.
It is tested on Python 2.7, 3.5, 3.6 and 3.7.
Note
This has not been authorised by the PyGame team. The author is not associated with them.
You will still need to install and use PyGame, their documentation and follow their licenses.
You might even like to contribute to their project! Perhaps you can then politely convince them not to put spam in stdio?
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
File details
Details for the file pygamesilent-1.0.0.tar.gz
.
File metadata
- Download URL: pygamesilent-1.0.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb701d82e39c4b6359770a96a11ef23f42b11b91b2918283246343cdd17bbc09 |
|
MD5 | ab30e5995d8f43a988a5d85c363724c9 |
|
BLAKE2b-256 | c94d2fa214a83b7180c92b0e17a873e17663855f60ee30849d86c4343afaa2e3 |
File details
Details for the file pygamesilent-1.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: pygamesilent-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08febd05e092a1cd82c14b570944f94e2e5126015c25975792163263882c792a |
|
MD5 | a5464d3a6233dca5e1f41fe40ea2a13c |
|
BLAKE2b-256 | f4fd6439e8281c418ffae1e36d2a8883e8973397f94c23ab0fc368a2d141bb3c |