I'm trying to use glob and os to locate the most recent .zip file in a directory. Funny thing is, I had the following set up and it was working previously:
max(glob.glob('../directory/*.zip'), key=os.path.getctime)
Running this now gets me max() arg is an empty sequence, which makes sense because when I try this:
glob.glob('../directory/*.zip')
it returns nothing but an empty list. Using the full path also gets me an empty list. Trying other directories also gets me an empty list. I'm very confused about what's going on here given this worked perfectly previously. Help?
EDIT: Got it to work again using:
glob.glob(/Users/*/directory/*.zip)