The official Python port of libtcod, a library for roguelike game development providing field-of-view, pathfinding, noise, and color handling. Current version is 21.2.0 (requires Python >=3.10), released semi-regularly with support for SDL3, free-threaded Python (3.14t wheels), and event improvements.
pip install tcodNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Minimal tcod application: load tileset, create context, print text, and run event loop until quit.
Use tcod.event.KeySym.UP or KeySym["UP"] instead of tcod.event.K_UP. For PY3.13+, KeySym.UP works; for older Python use KeySym['UP'].
Check for None before unpacking: logical_size = renderer.logical_size; if logical_size: width, height = logical_size
Replace set_tile(codepoint, tile) with tileset[codepoint] = tile and get_tile(codepoint) with tileset[codepoint].
Set os.environ['SDL_RENDER_SCALE_QUALITY'] = 'linear' before import tcod for linear interpolation scaling.
Run 'pip install tcod' in your active Python environment.
Use 'from tcod import event' first, then access event.*.
Use 'from tcod.event import KeySym'.
Provide correct path to a valid tilesheet image (e.g., 'dejavu10x10_gs_tc.png' from tcod's examples).