import os import sys import math from importlib import import_module from pixel import Screen WIDTH, HEIGHT = 100, 30 # Set to -1, -1 for dynamic resolution STD_HANDLE = 1 # Would want this to be 0, but it can cause issues if len(sys.argv) < 2: # Randomly select a shader from glob import glob from random import choice module = import_module( choice( glob("shaders/*.py") ).rstrip(".py").replace("\\", ".") ) else: module = import_module("shaders.%s" % sys.argv[1]) screen = Screen(WIDTH, HEIGHT, STD_HANDLE, [ module.main ]) screen.mainloop()