mejor orden
This commit is contained in:
parent
4712901043
commit
519d7429e0
@ -11,13 +11,14 @@ def reporta(p):
|
||||
print(eighths_scale(p, scale), p.name())
|
||||
|
||||
|
||||
|
||||
p = psutil.Process(pid=random.choice(psutil.pids()))
|
||||
print('random chose', reporta(p))
|
||||
|
||||
# walk from init
|
||||
p = psutil.Process(pid=1)
|
||||
|
||||
while True:
|
||||
reporta(p)
|
||||
|
||||
sleep(1)
|
||||
|
||||
children = p.children()
|
||||
|
||||
if children:
|
||||
@ -25,11 +26,10 @@ while True:
|
||||
for subp in
|
||||
children]))
|
||||
print("\t↳", end="")
|
||||
reporta(p)
|
||||
|
||||
else:
|
||||
p = psutil.Process(pid=random.choice(psutil.pids()))
|
||||
print('→', end="")
|
||||
reporta(p)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user