mirror of
https://github.com/metafy-social/python-scripts.git
synced 2025-03-15 18:19:52 +00:00
commit message
This commit is contained in:
parent
15836a94bf
commit
3862e859d0
11
scripts/Clean_the_folder/Clean.py
Normal file
11
scripts/Clean_the_folder/Clean.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import os
|
||||||
|
folder_location = 'C:\\Users\\user\\Downloads\\demo'
|
||||||
|
|
||||||
|
os.chdir(folder_location)
|
||||||
|
list_of_files = os.listdir()
|
||||||
|
|
||||||
|
images = [content for content in list_of_files if content.endswith(('.png','.jpg','.jpeg'))]
|
||||||
|
|
||||||
|
for index, image in enumerate(images):
|
||||||
|
os.rename(image,f'{index}.png')
|
||||||
|
|
4
scripts/Clean_the_folder/readme.md
Normal file
4
scripts/Clean_the_folder/readme.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Cleaning Download Folder
|
||||||
|
One of the messiest things in this world is the download folder of a developer. When writing a blog, working on a project, something similar we just download images and save them with ugly and funny names like asdfg.jpg.
|
||||||
|
|
||||||
|
This python script will clean your download folder by renaming and deleting certain files based on some condition.
|
1
scripts/Clean_the_folder/requirements.txt
Normal file
1
scripts/Clean_the_folder/requirements.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
# Dont forget to import OS
|
Loading…
x
Reference in New Issue
Block a user