Author: christophe@pallier.org
Date: 05 Nov 2021
Warning: These instructions work for Ubuntu 20.04 LTS focal (will probalby need some modifications for another Ubuntu distribution)
#! /usr/bin/env python3 | |
# Time-stamp: <2019-11-03 10:53:53 christophe@pallier.org> | |
""" Cleanly format the output of ``du``. | |
Example: | |
du Documents/ | sort -rn | pretty_du | head |
/* Play a sound file (wav format) passed on the command line, using libsdl2 | |
* | |
* Time-stamp: <2021-05-26 14:58:39 christophe@pallier.org> | |
* | |
* Compile with: | |
* cc -W -Wall $(sdl2-config --cflags) test_playsound.c $(sdl2-config --libs) -o test_playsound | |
*/ | |
#include <stdio.h> | |
#include <SDL2/SDL.h> |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
const char* DELIMITERS = "!\"#$%&'()*+,-./:;<=>?@[]^_`{|}~\\\t\n\r "; | |
int main(int argc, char* argv[]) | |
{ | |
FILE* fd; |
Author: christophe@pallier.org
Date: 05 Nov 2021
Warning: These instructions work for Ubuntu 20.04 LTS focal (will probalby need some modifications for another Ubuntu distribution)
expyriment is a great Python library to program psychology experiments.
However pip install expyriment
fails with many versions of Python because it tries to recompile pygame
Here we show how to use pyenv to create an environement with Python 3.7.6 in which "pip install expyriment" should work.
sudo apt install -y python3-pip python-is-python3 python3.10-venv
sudo apt install curl libssl-dev liblzma-dev libbz2-dev libsqlite3-dev libffi-dev tk-dev
curl https://pyenv.run | bash
cat >> ~/.bashrc <<EOF
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"