Relatively new to Python -- I have several csv files at dir2. I only want csv files starting with myfile_xxx.csv . I want to use glob.glob and print names of all csv files available starting with myfile. Here is the code I used
import glob
path = "C:/Users/dir1/dir2"
os.chdir(path)
print(os.getcwd())
for filenames in sorted(glob.glob('path/myfile?.csv')):
print(filenames)
Output doesn't print filenames. What is wrong here ...?