Answers for "find file python3"

5

how to search for a specific file extension with python

import glob, os
os.chdir("/mydir")
for file in glob.glob("*.txt"):
    print(file)
Posted by: Guest on March-06-2020
2

open file in python directory

path = 'C:\Users\Username\Path\To\File'
file=open(path, "r")
Posted by: Guest on May-13-2020

Python Answers by Framework

Browse Popular Code Answers by Language