ok so i'm stumped
import random
import subprocess
import os
wallList = []
for line in subprocess.check_output("ls -1 /home/corn/Wallpaper", shell=True).decode().splitlines():
wallList.append(line.strip())
last = open('last.txt', 'r')
print(last.read())
lastWall = last.read()
last.close()
maxIndex = len(wallList) - 1
sel = random.randint(0, maxIndex)
valid = False
choice = f'/home/corn/Wallpaper/{wallList[sel]}'
while valid is False:
print(choice)
print(lastWall)
if wallList[sel] == lastWall:
print("nuh uh")
else:
valid = True
com = ['feh', '--bg-scale', choice]
command = ""
for item in com:
command += f'{item} '
print(command.strip())
subprocess.run(com)
last = open('last.txt', 'w')
last.write(choice)
last.close()
trying to make a wallpaper switcher script for bspwm
when the last wallpaper and the current one are equal the if statement doesn't see it
example attached