Python Forum

Full Version: Need info for getting directory content in Windows
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm new to Python and am looking at tutorials, etc., to learn the language. What I haven't been able to find is information, either code examples or pointers to documentation, on how to get directory contents in Windows. I need to be able to access Windows directory contents and then rename the files contained therein.

TIA,

Bill
Windows isn't any different than other operating systems in this manner except that the names can be a bit different. Take a look at the OS Module. That has functions to read directories and rename files like listdir() and rename().
Thank you very much,

Bill