Answers for "python iterate through a text file"

0

python iterate through files

import os

directory = os.fsencode(directory_in_str)
    
for file in os.listdir(directory):
     filename = os.fsdecode(file)
     if filename.endswith(".asm") or filename.endswith(".py"): 
         # print(os.path.join(directory, filename))
         continue
     else:
         continue
Posted by: Guest on July-05-2021

Code answers related to "python iterate through a text file"

Python Answers by Framework

Browse Popular Code Answers by Language