HTML IDs removed in various versions of CPython docs.
3.10 is skipped; couldn't get it to build quickly. These are not YAML; extensions are just to get syntax highlighting on GitHub.
HTML IDs removed in various versions of CPython docs.
3.10 is skipped; couldn't get it to build quickly. These are not YAML; extensions are just to get syntax highlighting on GitHub.
| """Super-minimal 'curses'; values _pyrepl needs hardcoded & non-portable. | |
| Use this instead of _pyrepl._minimal_curses; test well with *your* terminal. | |
| """ | |
| class error(Exception): | |
| pass | |
| OK = 0 | |
| ERR = -1 |
| # Set the following variables, then run the following in a CPython checkout. | |
| # Note that with LTO, `git clean` (or another clean) is necessary. Don't put | |
| # results in your source checkout as the clean will remove them. | |
| # SCRIPT -- path of this file | |
| # DESTDIR -- destination for the output | |
| # git clean -fxd | |
| # ./configure --prefix=$PWD/__installed__ -C --enable-optimizations --with-lto |
A printer-friendly style for the PyCon US 24 schedule pages, taken from Hugo's blog post.
Paste the following into the browser console. (You might get a warning about not pasting code you don't understand -- it's there for the same reasons why I don't like installing browser extensions that someone recommends to me.)
The style will only change when you print (or do a print preview).
var sheet = document.createElement("style");
sheet.innerHTML = `
@media print {| // vraci staticky retezec, nevolat free() | |
| char *nazev_jednoducheho_cisla(int n) { | |
| switch (n) { | |
| case 0: return "nula"; | |
| case 1: return "jedna"; | |
| case 2: return "dva"; | |
| case 3: return "tri"; | |
| case 4: return "ctyri"; | |
| case 5: return "pet"; |
| import unicodedata | |
| def get_components(char): | |
| name = unicodedata.name(char).removeprefix('BOX DRAWINGS ') | |
| result = [] | |
| for part in name.split(' AND '): | |
| part = part.replace(' DASH', '-DASH') | |
| directions = [] | |
| for word in part.split(): | |
| match word: |
| import inspect | |
| import sys | |
| import functools | |
| def trace(f): | |
| signature = inspect.signature(f) | |
| indent = '' | |
| @functools.wraps(f) | |
| def decorated(*a, **ka): |
Currently, several Python distributors modify the Python install layout. Making such modifications requires them to patch multiple standard library modules. The install layout is currently not meant to be a configurable option in a Python installation, but Python developers, distro packagers and module authors all have conflicting certain assumptions in this area. This has presented itself as problematic because Python distributors, understandably, fail to correctly modify all places required to satisfy all these assumptions, resulting in incoherent or straight-out broken Python distributions
| # Generator for: https://youtu.be/xeL_Ifngcbo | |
| # Save student code as obrazky/*.py and run this | |
| import sys | |
| import importlib | |
| from pathlib import Path | |
| import turtle | |
| import time | |
| import itertools | |
| import dataclasses |