Python Forum
Looking through files in explorer in order?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Looking through files in explorer in order?
#1
Hi everyone. I'm pretty new at Python, and am struggling with something. As you can see from the image attached, I am trying to re-name all the files in a particular folder to fit a pattern for a project I'm making. Before running the code, the images are all named "testimage(i), i being the number in the folder. The problem I have is that while this code does run, and does rename them the way I want. The order in which it is going through them is weird. It seems to do the first one called "testimage(1)", followed by "testimage(10)", through to 19, then it just starts getting like evry tenth number first. I'm really confused why this is happening, but essentially I want it to just go through the images in the order they appear in the explorer. Any suggestions would be really great. Thanks!

[Image: 4d4760a62decc6dbbd873a690411b731]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Rename files in a folder named using windows explorer hitoxman 3 692 Aug-02-2023, 04:08 PM
Last Post: deanhystad
  File explorer DPaul 9 2,042 Aug-05-2022, 06:00 AM
Last Post: DPaul
  Generate a string of words for multiple lists of words in txt files in order. AnicraftPlayz 2 2,756 Aug-11-2021, 03:45 PM
Last Post: jamesaarr
  Flask files running order TomasAm 0 1,433 Nov-12-2020, 08:22 AM
Last Post: TomasAm
  Odd behavior when starting Explorer.exe malonn 2 2,000 Sep-14-2020, 07:45 PM
Last Post: malonn
  Renaming explorer files in order? stroudie2 2 2,830 Mar-03-2019, 12:41 AM
Last Post: stroudie2
  Spyder hides middle array values in variable explorer window davidqvist 0 2,364 Aug-03-2018, 11:04 AM
Last Post: davidqvist
  Spyder IDE - make variable explorer to follow the color scheme of the Editor Antonio 0 5,395 May-05-2018, 10:20 PM
Last Post: Antonio

Forum Jump:

User Panel Messages

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