Python Forum

Full Version: how to open folder and change files in it
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone , I am a new member in this froum and need help , I want to develop an app that open a folder in my file system an list files and rename some of these files
Hi welcome,it's pretty straight forward using the os module.
Here some hints,as we don't write finish solution without some effort from your side.
Read files in a folder os.scandir().
Eg if file.endswith(('.txt', '.jpg')) to choose wanted formats.
Rename files os.rename().
Thanks snippsat for answer , that's I want , the module