5 years ago when I didn’t know programming, I was fed up doing boring stuff on my PC. Among them, organizing the download folder manually is on top. But later when I learned programming (especially python programming), I put this boring stuff on autopilot mode.
In this post, you are going to see a very simple python script that can make your download folder arranged.
Above code loops through all the files of the download folder and moves them.
move function checks the file type and sends the file to its corresponding folder (If the folder is not present, it will be created).
This file contains the functions that are responsible for checking the file type. If all goes fine, run main.py
Don’t forget to change the paths according to your folder paths.
Boom!! Your download folder is not cluttered anymore!!
Flask Web Application to Classify Image using VGG16
Nowadays it is easy to make an image classifier as we have got some powerful tools like Keras, TensorFlow, PyTorch…
How to be A Pragmatic Programmer: Part One (1)
Pragmatic Programmer is something that every programmer wants to be. This article aims to narrate the characteristics…
See! So simple! Right!
Now play with these codes to make your own version of automation.
NOTE: I only focused on automation, not on clean code. So make sure to write clean code ☺.
Wait, one minute! How does this become an automation system when you need to run the code manually?
This part can be solved using crontab (my os — Ubuntu 18.04). At first install crontab.
sudo apt-get install cron
Now edit the cron file with nano editor,
Add this ( *change path )
*/30 * * * * /usr/bin/python3 /home/arif/python-projects/python-easy-code/others/organaize_download_folder/main.py >> /home/arif/cronjob.log 2>&1
I let the cron run my main.py every 30 minutes interval. The full details cron log is saved to my home folder.
Don’t forget to press 👏 so that others can reach it.