%timeit -n 1 -r 1 test_function()
where n is the number of consecutive tests and r is the repetition for each test
| # Create from folder | |
| ffmpeg -framerate 1 -pattern_type glob -i '/tmp/ciao/*.png' -c:v libx264 -r 30 -pix_fmt yuv420p /tmp/out.mp4 | |
| # Repeat video until CTRL+c (is very dense! ) | |
| ffmpeg -stream_loop -1 -i /tmp/out.mp4 -c copy /tmp/out_repeat.mp4 | |
| # Convert into MP4 yuv420p |
| # launch pytest on single file/class/function | |
| pytest <FILE_NAME>::<CLASS_NAME>::<FUNCTION_NAME> |
| # Definition | |
| from collections import defaultdict | |
| def tree(): return defaultdict(tree) | |
| # Sample | |
| t = tree() | |
| t['one']['two']['three']=1.23 | |
| import sys, numpy as np, fire, sty | |
| from PIL import Image | |
| def print_image(filename, scale=0.1, ratio=7/4, character='█'): | |
| """ | |
| Args: | |
| filename (Str): input image | |
| scale (float): output scale. Default [0.1], means 48 cells width | |
| ratio (float): image2cells ratio. Default [7/4] | |
| character (char): character used to fill cells |
| rsync -avz --exclude '*.txt' source/ destination/ |
| find . -name "*.xml" -type f|xargs rm -f |
| #!/bin/bash | |
| for i in $(seq -f "%05g" 00 10 50); | |
| do | |
| echo $i | |
| done |