Paulo Laureano Because coding is fun!

Example "basic window" in Python

This example uses python 3 with a Raylib (https://www.raylib.com) wrapper (https://pypi.org/project/raylib/) that uses CFFI API static bindings (this is the fastest approach, and keeps the code as close as possible to the original C, which I feel is the best approach when using a C library).

Original Raylib C code in example 1 converted to python…

Python version (using https://pypi.org/project/raylib/#description):


from raylib.static import *

screenWidth = 800
screenHeight = 450

InitWindow(screenWidth, screenHeight, b"raylib [core] example - basic window")

SetTargetFPS(60)


while not WindowShouldClose():
BeginDrawing()
ClearBackground(RAYWHITE)
DrawText(b"Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY)
EndDrawing()
CloseWindow()