Skip to content

Instantly share code, notes, and snippets.

@aliyevorkhan
Created September 9, 2020 22:22
Show Gist options
  • Save aliyevorkhan/b1e0eceec3542e174bb3826949c33214 to your computer and use it in GitHub Desktop.
Save aliyevorkhan/b1e0eceec3542e174bb3826949c33214 to your computer and use it in GitHub Desktop.
import os
for file in os.listdir(os.getcwd()):
if file.endswith('.txt'):
os.remove(file)
@aliyevorkhan
Copy link
Author

this script is able to remove .txt files in current directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment