2024-10-26 04:11:20 +00:00
|
|
|
import psutil
|
|
|
|
|
import random
|
|
|
|
|
from time import sleep
|
2024-10-29 02:58:45 +00:00
|
|
|
from mupah import eighths_scale
|
|
|
|
|
import mingus.core.scales as scales
|
|
|
|
|
|
|
|
|
|
scale = scales.Aeolian("C").ascending()
|
2024-10-26 04:11:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def reporta(p):
|
2024-10-29 02:58:45 +00:00
|
|
|
print(eighths_scale(p, scale), p.name())
|
2024-10-26 04:11:20 +00:00
|
|
|
|
|
|
|
|
|
2024-10-29 02:58:45 +00:00
|
|
|
|
2024-10-26 04:11:20 +00:00
|
|
|
p = psutil.Process(pid=random.choice(psutil.pids()))
|
|
|
|
|
print('random chose', reporta(p))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while True:
|
|
|
|
|
sleep(1)
|
|
|
|
|
children = p.children()
|
|
|
|
|
|
|
|
|
|
if children:
|
|
|
|
|
p = psutil.Process(pid=random.choice([subp.pid
|
|
|
|
|
for subp in
|
|
|
|
|
children]))
|
2024-10-29 02:58:45 +00:00
|
|
|
print("\t↳", end="")
|
|
|
|
|
reporta(p)
|
2024-10-26 04:11:20 +00:00
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
p = psutil.Process(pid=random.choice(psutil.pids()))
|
2024-10-29 02:58:45 +00:00
|
|
|
print('→', end="")
|
|
|
|
|
reporta(p)
|
2024-10-26 04:11:20 +00:00
|
|
|
|
|
|
|
|
|