Skip to content

triposat/PC_Cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation


Prettier Size
sds

Description:

  • Let's look at a Python script that will place all of your files in the appropriate folder.
  • This script will first list all of the files and place them in folders based on their extensions, such as ".pdf" which will be placed in the PDFs folder, and so on for all of the files.
  • Finally, all of the files will be placed in their proper directories.

Procedure to follow:

  • Import OS module
  • Using the chdir function, change the location where the files will be imported.
  • List all of the files using the listdir function, and then delete any files that don't have an extension like any folder.
  • Run a loop for all of the files, putting them in the appropriate folders based on their extensions.
  • Finally, each file will be placed in its own folder.

Output:

Before:

output_1 (1)

After:

output_2 (1)

About

Python script that will place all of your files in the appropriate folder!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages