Python Forum
Need info for getting directory content in Windows
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need info for getting directory content in Windows
#1
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
Reply
#2
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().
Reply
#3
Thank you very much,

Bill
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  working directory if using windows path-variable chitarup 2 682 Nov-28-2023, 11:36 PM
Last Post: chitarup
  What is all the info in the info window in Idle? Pedroski55 3 647 Jul-08-2023, 11:26 AM
Last Post: DeaD_EyE
  [SOLVED] [Windows] Right way to prompt for directory? Winfried 4 1,996 Jan-17-2023, 09:28 PM
Last Post: markoberk
  How do I read the HTML files in a directory and write the content into a CSV file? glittergirl 1 2,560 Sep-23-2019, 11:01 AM
Last Post: Larz60+
  How do I run python scripts from any directory using Windows command prompt? bigmit37 4 15,675 Jun-15-2017, 04:13 PM
Last Post: Larz60+
  Windows/DOS python script cannot create a directory name beginning an @ at-sign LucRhan 6 5,986 May-08-2017, 08:03 PM
Last Post: volcano63

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020