Disable spinner in non interactive mode
Created by: Zaharid
Print something to the terminal instead. This avoids needlessly cluttering CI outputs.
Example
import time
import sys
import subprocess
from validphys.renametools import Spinner
with Spinner():
time.sleep(5)
if sys.argv[-1] != "no":
print(
subprocess.run(
[sys.executable, __file__, "no"], capture_output=True, text=True
).stdout
)