Python Forum
Retrieving last 20 file paths from directory
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Retrieving last 20 file paths from directory
#3
Awesome, thanks! Say I wanted to print the last 20 file paths from separate directories. For example, my setup would be:

(r'\\directory\asset1\asset1_runfile')
(r'\\directory\asset2\asset2_runfile')
(r'\\directory\asset3\asset3_runfile')
(r'\\directory\asset4\asset4_runfile')

How would I go about printing the last 20 file names of each "asset" without writing the same code with that slight variation over and over?
Reply


Messages In This Thread

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to solve the 'NO SUCH DIRECTORY OR FILE' in pandas, python MohammedSohail 10 15,836 May-08-2020, 07:45 AM
Last Post: nnk
  paths Scott 13 8,355 May-16-2018, 06:25 AM
Last Post: Scott

Forum Jump:

User Panel Messages

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