I'm trying to write the psutil.test()
result to a file but instead it prints out the text that I want in the file and writes "None" to the test.txt
.
import psutil
from time import sleep
while True:
proccesses = psutil.test()
file = open("test.txt", "a")
file.write(str(proccesses))
file.write("\n" * 10)
file.close()
sleep(5)