ls in python code example
Example 1: os list all files in one dir
import glob
print(glob.glob("/home/adam/*.txt"))
Example 2: list files python
#get all .txt files in my_path
import glob
my_path='/home/folder/'
files=glob.glob(my_path+'*.txt')
import glob
print(glob.glob("/home/adam/*.txt"))
#get all .txt files in my_path
import glob
my_path='/home/folder/'
files=glob.glob(my_path+'*.txt')