Код: Выделить всё
import pygetwindow as a
import os, time
#Just a few words that it'll ignore
ignore = [
"Spotify", "Firefox", "Steam", "Discord", "File explorer", "Notepad"
]
while True:
titles = a.getAllTitles()
for b in titles:
#I check for the hyphen because when a song is playing in Spotify it will always be "artist" - "song name" so I thought that might filter some unwanted stuff out
if " - " in b:
if not any(c.lower() in b.lower() for c in ignore):
print(b)
#IDK if its wierd to do this but I just don't like the terminal being overflowed with stuff
time.sleep(1)
os.system('cls' if os.name == 'nt' else 'clear')
Мобильная версия