SFME | Simple and Fast Multimedia Engine | Game Engine library
kandi X-RAY | SFME Summary
kandi X-RAY | SFME Summary
SFME (Simple and Fast Multimedia Engine) is an engine divided into several modules which do not necessarily depend on each other. Therefore, you can use the whole engine or only one module, it just depends on your needs.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of SFME
SFME Key Features
SFME Examples and Code Snippets
Community Discussions
Trending Discussions on SFME
QUESTION
I've searched through many answers on deleting multiple files based on certain parameters (e.g. all txt files). Unfortunately, I haven't seen anything where one has a longish list of files saved to a .txt (or .csv) file and wants to use that list to delete files from the working directory.
I have my current working directory set to where the .txt file is (text file with list of files for deletion, one on each row) as well as the ~4000 .xlsx files. Of the xlsx files, there are ~3000 I want to delete (listed in the .txt file).
This is what I have done so far:
...ANSWER
Answered 2018-Oct-11 at 04:55- Strip ending
'\n'
from each line read from the text file; - Make absolute path by joining
path
with the file name; - Do not overwrite Python types (i.e., in you case
list
); - Close the text file or use
with open('DeleteFiles.txt') as flist
.
EDIT: Actually, upon looking at your code, due to os.chdir(path)
, second point may not be necessary.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install SFME
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page