Python Forum
get all the files in the path in a list?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
get all the files in the path in a list?
#4
this is what I have try to do:
from pathlib import Path
Test_Path = Path("C:\\Test\\")

 for file in Test_Path:
        print(file)
but I get TypeError:
for file in Test_Path:
TypeError: 'WindowsPath' object is not iterable
and if I can't even print it - I guess I will have problem working with him for FTP uplaod
Reply


Messages In This Thread
RE: get all the files in the path in a list? - by korenron - Jul-11-2021, 09:34 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  does not save in other path than opened files before icode 3 1,146 Jun-23-2023, 07:25 PM
Last Post: snippsat
  list the files using query in python arjunaram 0 769 Mar-28-2023, 02:39 PM
Last Post: arjunaram
  How to download a list of files from FTP? schnarkle 0 1,092 Jun-21-2022, 10:35 PM
Last Post: schnarkle
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 2,339 Sep-09-2021, 01:25 PM
Last Post: Yoriz
  Put all files in a directory into list. How? Denial 2 2,278 Sep-18-2020, 10:05 PM
Last Post: Larz60+
  Python - List from csv files Wscwt011 1 1,963 Mar-18-2020, 06:22 PM
Last Post: alpho
  How to list out specific excel files ajay_pal7 2 2,953 Mar-10-2020, 05:43 AM
Last Post: Larz60+
  How to get full path of specified hidden files matching pattern recursively SriRajesh 4 4,142 Jan-18-2020, 07:12 PM
Last Post: SriRajesh
  Downloading And Saving Zip Files To A Particular Path Folder eddywinch82 2 2,688 Jan-06-2020, 07:56 PM
Last Post: eddywinch82
  unable to list files in a directory christober 2 2,149 Sep-18-2019, 11:45 PM
Last Post: wavic

Forum Jump:

User Panel Messages

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