pyprojector
pyprojector is a Python 3 module that creates an interpreter independent window. Tight loops, long calculation often prevents us from updating a window, using Python threads adds more complexity and a choppy rendering experience.
How pyprojector works?
A window is created on a new OS thread, the WinAPI takes care of the window.
The window has two OpenGL contexts with shared objects.
The user can use the the OpenGL context assigned to the current thread to render arbitrary images using OpenGL. The window.update(framebuffer=...) method takes a framebuffer and copies its content into a backbuffer. The backbuffer will be used anytime the window needs a redraw.
Features
- The user can create and update a window with a minimal API.
- The rendered frames are quickly copied to a backbuffer maintained by another thread.
- The user can render depending on the window's visibility.
- A hidden window have an almost zero performance penalty.
- The user is not responsible updating a window to avoid dirty frames.
- The window can be shown/hidden from the system tray.
- Closing the window just hides the window.
- A screenshot can be saved with
ctrl+s. - A
ctrl+cin the window raises aKeyboardInterrupt. - A screenshot can be taken programatically using
window.screenshot(). - The program can be halted with
ctrl+shift+q. - The window is refreshed only when necessary.
- There is a builtin FPS limiter.
Example
import pyprojector
wnd = pyprojector.window((840, 480), __file__, fps=60)
fbo = ... # OpenGL Framebuffer Object
while True:
# the user's loop
# do long calculation, train AI, run gyms, ...
if wnd.visible:
# render into fbo
# pass fbo to the window
wnd.update(fbo)
for more examples please visit the examples.
Acknowledgement
This project is using miniz to save PNG files.
Metadata
Release files for pyprojector 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyprojector-1.0.1.tar.gz | 104.0 kB | Without provenance | Details for pyprojector-1.0.1.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| pyprojector-1.0.1-cp37-cp37m-win_amd64.whl | CPython 3.7 | CPython 3.7 pymalloc | Windows x86-64 | Details for pyprojector-1.0.1-cp37-cp37m-win_amd64.whl |
| pyprojector-1.0.1-cp37-cp37m-win32.whl | CPython 3.7 | CPython 3.7 pymalloc | Windows x86-32 | Details for pyprojector-1.0.1-cp37-cp37m-win32.whl |
| pyprojector-1.0.1-cp36-cp36m-win_amd64.whl | CPython 3.6 | CPython 3.6 pymalloc | Windows x86-64 | Details for pyprojector-1.0.1-cp36-cp36m-win_amd64.whl |
| pyprojector-1.0.1-cp36-cp36m-win32.whl | CPython 3.6 | CPython 3.6 pymalloc | Windows x86-32 | Details for pyprojector-1.0.1-cp36-cp36m-win32.whl |
Total release size: 222.9 kB
Release files / pyprojector-1.0.1.tar.gz
| Download URL | pyprojector-1.0.1.tar.gz |
|---|---|
| Size | 104.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
154b2d764d32f2a4c848e878584144b5037eba310f10fbaa4a4ef3bbacfc2bd1
|
|
BLAKE2b-256 checksum How to use checksums |
29bc7d35d82be9e3fe53bb1cc7ebf75224be7e7eff42b3440be04657161ca08a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
|
Release files / pyprojector-1.0.1-cp37-cp37m-win_amd64.whl
| Download URL | pyprojector-1.0.1-cp37-cp37m-win_amd64.whl |
|---|---|
| Size | 30.6 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ecd1b05262d8201cb54b31ee6cca30e441e4789efc87dcf23e7a6a548683fbfd
|
|
BLAKE2b-256 checksum How to use checksums |
b113fee169b59f72ca16c6d638de737882dc05d8ecc44c277099726694eac9fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
|
Release files / pyprojector-1.0.1-cp37-cp37m-win32.whl
| Download URL | pyprojector-1.0.1-cp37-cp37m-win32.whl |
|---|---|
| Size | 28.9 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
ee2c0dda3c0bc8ad521671643e242d7e4f0ba34d807734949dff17df4b7bd18e
|
|
BLAKE2b-256 checksum How to use checksums |
a0d011d23293b25aabd761b3e722ba38d232555759842185938126d12ced17e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
|
Release files / pyprojector-1.0.1-cp36-cp36m-win_amd64.whl
| Download URL | pyprojector-1.0.1-cp36-cp36m-win_amd64.whl |
|---|---|
| Size | 30.6 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
00c336cac3b96c819938a236eb57f664faa11b7e26db9a012a08456074b86b03
|
|
BLAKE2b-256 checksum How to use checksums |
470099153ba0f99c8d5cf744a5948082057ea49ee04ae9a40188e3a376efb73c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
|
Release files / pyprojector-1.0.1-cp36-cp36m-win32.whl
| Download URL | pyprojector-1.0.1-cp36-cp36m-win32.whl |
|---|---|
| Size | 28.9 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
f71b982ab4998f8f7142ff8b2ed6c04b31126a4be0021b11412bb7ea61bd6b79
|
|
BLAKE2b-256 checksum How to use checksums |
1ff7bba560b2610805300b5f7ba297df2cb4260acfe8078c12fdaae7144a829c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
|
Security for pyprojector 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.