Dwarf Fortress это такой симулятор, в котором примитивнейшая графика, но при этом в мире игры обсчитывается чуть ли не масса каждой травинки, и это влияет на всё происходящее. Был такой научпоп-факт, что если из мира убрать муравьёв, то всё погибнет. Вот в Dwarf Fortress вполне возможны такие случаи. В сети есть история, как в одной крепости стали погибать коты, потому что они вылизывали свою шерсть, а она была пропитана пивом из-за того, что они ходили по пивным лужам.
Я сам не играю из-за слишком уж абстрактной графики и высокого порога вхождения. Но сама идея крутая и увлекает тысячи игроков на сотни часов.
Так вот, разработчики 20 лет делают мега-задротную игру для мега-задротов. Иронично, что они сами выглядят при этом как супер стереотипные задроты. И я уверен, что они совершенно счастливы, и тот факт, что они заработали миллионы баксов, лишь совсем небольшая составляющая этого счастья.
#games
#Functions are first-class citizens in Python:
# They can be passed as arguments to other functions,
# returned as values from other functions, and
# assigned to variables and stored in data structures.
»> def myfunc(a, b):
... return a + b
...
»> funcs = [myfunc]
»> funcs[0]
<function myfunc at 0x107012230>
»> funcs[0](2, 3)
5
# Functions are first-class citizens in Python.
# They can be passed as arguments to other functions,
# returned as values from other #functions, and
# assigned to variables and stored in data structures.
»> def myfunc(a, b):
... return a + b
...
»> funcs = [myfunc]
»> funcs[0]
<function myfunc at 0x107012230>
»> funcs[0](2, 3)
5
https://docs.python.org/3/library/subprocess.html
The #subprocess module allows you to spawn new #processes, connect to their input/output/error pipes, and obtain their return codes. This module intends to replace several older #modules and #functions.
#python
https://docs.python.org/3/library/atexit.html
The #atexit module defines #functions to #register and #unregister cleanup functions. Functions thus registered are automatically executed upon normal interpreter termination. atexit runs these functions in the reverse order in which they were registered; if you register A, B, and C, at #interpreter#termination time they will be run in the order C, B, A.