Skip to content

Instantly share code, notes, and snippets.

Avatar

Petr Viktorin encukou

View GitHub Profile
View python-vendor-config.md

Python Vendor Configuration

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

View obrazky.py
# 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
View sw.url
https://github.com/encukou/piskvorky
View zavrit.py
# pip install pyglet
import pyglet
window = pyglet.window.Window(
style=pyglet.window.Window.WINDOW_STYLE_BORDERLESS,
resizable=True,
)
label = pyglet.text.Label('Zavřít ', font_name=['Fira Mono', 'Courier New'])
View shapedclock.py
# Shaped clock, adapted from:
# https://doc.qt.io/qt-6/qtwidgets-widgets-shapedclock-example.html
# pip install pyside6
from PySide6 import QtWidgets, QtCore, QtGui
app = QtWidgets.QApplication([])
class ShapedClock(QtWidgets.QWidget):
def __init__(self):
View turnaj.md

Turnaj v piškvorkách - podzim 2020

Účastnice:
    drak-1o
    kocka-1
    kun-2
    liska-1
 motyl-2
View quick-pypi-proxy.py
# To install/run/use, in a venv:
#
# $ python -m pip install flask flask-basicauth requests
# $ export FLASK_APP=quick-pypi-proxy.py
# $ export FLASK_DEBUG=1
# $ flask run
#
# $ python -m pip install --index-url http://127.0.0.1:8089/simple notebook
#
# (If you're testing pip with --use-feature=fast-deps, turn it off.)
View demo.c
#include <stdio.h>
#include <stdlib.h>
struct node {
int number;
struct node *left;
struct node *right;
};
void print_tree(struct node *tree, int depth, char rl) {
View stranka.html
<!DOCTYPE html>
<!--
Tento soubor si otevři ve webovém prohlížeči.
Často v prohlížeči jde otevírat pomocí Ctrl+O.
-->
<html>
<head>
<title>HTML stránka</title>
View dnf-api-example.py
import dnf
cachedir = '_dnf_cache_dir'
the_arch = 'x86_64'
base = dnf.Base()
conf = base.conf
conf.cachedir = cachedir
conf.substitutions['releasever'] = '32'
conf.substitutions['basearch'] = the_arch