Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Found some non-cleaned up file names
Not sure what they mean by "Found some non-cleaned up file names"
If date = "2015-10-31" and interpreting that we are already in the 'backups' folder. I came up with this:
for files in os.scandir():
Doing this code in vs.code. It does delete all files the start with whatever date that is giving to the 'date' argument. Like '2015-10-31'.
Assuming all files have the format "year-month-day-username.extension", I also used files.name.contains(date), in place of files.name.startswith(date), but I got the same error.
Steven Parker228,978 Points
By default, scandir will examine the current directory, but the instructions say the function should work on files in the "backups" local directory instead.
Also, the instructions say to delete matching files instead of renaming them.