Programming With Swift
  • Home
  • About
  • Github
Sign in Subscribe

Python

A collection of 2 posts
Python list all files in directory and subdirectories
Python

Python list all files in directory and subdirectories

Getting a list of all files in a directory and its subdirectories can be quite a common task, so, in this tutorial I will show you how you can do this with 4 lines of code using os.walk. Below you can see how we can recursively loop through all
15 Sep 2021 1 min read
Python - list all files starting with given string/prefix
Python

Python - list all files starting with given string/prefix

In this tutorial I will show you how to list all files in a directory where those files start with a given string/prefix. Find files in the current directory To loop through the provided directory, and not subdirectories we can use the following code: for file in os.listdir(
18 Aug 2020 1 min read
Page 1 of 1
Programming With Swift © 2025
Powered by Ghost