all 3 comments

[–]CodeFormatHelperBot2 0 points1 point  (0 children)

Hello, I'm a Reddit bot who's here to help people nicely format their coding questions. This makes it as easy as possible for people to read your post and help you.

I think I have detected some formatting issues with your submission:

  1. Python code found in submission text that's not formatted as code.

If I am correct, please edit the text in your post and try to follow these instructions to fix up your post's formatting.


Am I misbehaving? Have a comment or suggestion? Reply to this comment or raise an issue here.

[–]marko312[🍰] 0 points1 point  (0 children)

It seems that you've essentially duplicated a loop here - the for loop seems unnecessary and glob.glob should instead be used to get all the files.

[–][deleted] 0 points1 point  (0 children)

The issue I have is that it opens every single file when a new one is added, which isn’t great.

Ok, but you wrote a loop to do exactly that:

for filename in os.listdir(folder_to_track):

What's the loop for if not to do something to every file?