Skip to content

Instantly share code, notes, and snippets.

View ianfab's full-sized avatar

Fabian Fichter ianfab

  • Heidelberg, Germany
  • 17:35 (UTC +01:00)
View GitHub Profile
@karolzlot
karolzlot / tqdm_cpu_ram.py
Last active November 12, 2024 04:02
Monitoring real time cpu and ram usage with tqdm. If you like it please upvote this answer: https://stackoverflow.com/a/69511430/8896457
from tqdm import tqdm
from time import sleep
import psutil
with tqdm(total=100, desc='cpu%', position=1) as cpubar, tqdm(total=100, desc='ram%', position=0) as rambar:
while True:
rambar.n=psutil.virtual_memory().percent
cpubar.n=psutil.cpu_percent()
rambar.refresh()
cpubar.refresh()
@niklasf
niklasf / bratko-kopec.py
Last active February 24, 2020 15:37
An implementation of the Bratko-Kopec Test using python-chess
#!/usr/bin/python
import chess
import chess.uci
import sys
import time
MOVETIME = 120.0