Python Forum
How to list out specific excel files
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to list out specific excel files
#2
A starting point:
import os

for file in os.scandir():
    if file.is_dir():
        print('/', file.name, sep='')
    else:
        print(file.name)
When I run this I see:
Output:
model.py part_test.py regex.py sandbox.py __init__.py /__pycache__
Another interesting function in the os module are chdir(). You can read about them here: https://docs.python.org/2/library/os.html
Reply


Messages In This Thread
How to list out specific excel files - by ajay_pal7 - Mar-10-2020, 12:38 AM
RE: How to list out specific excel files - by deanhystad - Mar-10-2020, 04:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Copy Paste excel files based on the first letters of the file name Viento 2 503 Feb-07-2024, 12:24 PM
Last Post: Viento
  Search Excel File with a list of values huzzug 4 1,313 Nov-03-2023, 05:35 PM
Last Post: huzzug
  trouble reading string/module from excel as a list popular_dog 0 457 Oct-04-2023, 01:07 PM
Last Post: popular_dog
  list the files using query in python arjunaram 0 702 Mar-28-2023, 02:39 PM
Last Post: arjunaram
  python print all files which contain specific word in it mg24 5 1,311 Jan-27-2023, 11:20 AM
Last Post: snippsat
  python move specific files from source to destination including duplicates mg24 3 1,142 Jan-21-2023, 04:21 AM
Last Post: deanhystad
  How to loop through all excel files and sheets in folder jadelola 1 4,613 Dec-01-2022, 06:12 PM
Last Post: deanhystad
  Creating csv files from Excel file azizrasul 40 6,034 Nov-03-2022, 08:33 PM
Last Post: azizrasul
  search a list or tuple for a specific type ot class Skaperen 8 2,018 Jul-22-2022, 10:29 PM
Last Post: Skaperen
  list from excel devilonline 4 1,420 Jun-22-2022, 11:00 PM
Last Post: devilonline

Forum Jump:

User Panel Messages

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